---
title: "Update a Company"
method: PATCH
path: "/v1/companies/{id}"
tags: ["Companies", "v1"]
---

# Update a Company

`PATCH /v1/companies/{id}`

Update a company.

Applies a partial (merge-patch) update to the company: only the attributes named in the request are changed; any attribute you omit is left untouched. This endpoint updates the company's custom field values.

To set custom field values, send them under `attributes.custom_fields`, keyed by custom field id. The value type is inferred from the field definition — no `type` is sent in the request. Only simple field types may be set: `text`, `number`, `boolean`, and `date`. Prompt-capable / computed types (`ai_*`, `contact_collection`) and unknown custom field ids are rejected with `400`. The updated values are returned inside the entity's `data` envelope.

The request is validated strictly and applied atomically: if any field fails validation, the whole request is rejected and nothing is written. Per-field errors carry a `source.pointer` locating the offending field; when fields fail with different statuses, the response status is the most severe one (`403` over `400`). Sending `null` as a value clears that field (merge-patch delete); clearing a field with no stored value is a no-op. A maximum of 100 custom fields may be supplied per request.

Credit Note: Updating a company does not consume credits.

:::info
Requires the `custom_fields:write` OAuth2 scope.
:::

## Path parameters

- `id` string, required

## Query parameters

- `account_id` string, required

## Request body

- object
  - `data` object, required
    - `type` 'company', required — Must be 'company'.
    - `attributes` object, required
      - `custom_fields` object, required — Custom field values to set, keyed by custom field id. Merge-patch: only the fields named here are changed; omitted fields are left untouched. Max 100 fields. Only text/number/boolean/date fields may be set; ai_* / contact_collection are rejected (400). Send `null` as a value to clear a field.

## Response `200`

Company updated

- object
  - `data` object, required
    - `id` string, required — The public id of the updated company (numeric value as a string).
    - `type` 'company', required — The entity type.
    - `attributes` object, required
      - `custom_fields` object, required — The custom field values after the update, keyed by custom field id. Contains exactly the fields named in the request (merge-patch echo). Values are typed per the field definition: a number field yields a JSON number, a boolean field a JSON boolean, text and date fields a string (date is ISO-8601).
  - `meta` object, required
    - `request_id` string, required — A unique identifier assigned to each API request for end-to-end traceability.

## Other responses

- `400` — Invalid request. Structural failures (missing/empty `custom_fields`, more than 100 fields, a field patch without a `value` key) are rejected at the entity route with code `invalid_parameter`. Per-field failures (unknown custom field id, unsupported field type `ai_*` / `contact_collection`, value type mismatch) are reported by the custom-fields backend with code `bad_request` and a `source.pointer` locating the field; one error object is returned per failing field.
- `401` — Unauthorized. The request was rejected because the credentials are missing, invalid, expired, or have been revoked. The client must re-authenticate before retrying. Clients can differentiate via the `code` value of the first item in `errors`.
- `403` — The target custom field is read-only and cannot be set through the API.
- `404` — Not found
- `422` — A value passed the request-shape checks but failed domain validation at persistence time (rare).
- `429` — Too many requests. Either the per-second rate limit or the monthly quota configured for the API key / OAuth application has been exceeded. Clients can differentiate via the `code` value of the first item in `errors`.
- `500` — Internal server error
- `504` — Server timeout

---

[API](https://skmtc.net/leadfeeder/apis/leadfeeder-public-api.md) · [All operations](https://skmtc.net/leadfeeder/apis/leadfeeder-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/leadfeeder/leadfeeder-public-api/versions/e494ac05e206/schema)
