---
title: "Perform batch operations on a company's fields"
method: PATCH
path: "/v2/companies/{companyId}/fields"
tags: ["Companies"]
---

# Perform batch operations on a company's fields

`PATCH /v2/companies/{companyId}/fields`

Perform batch operations on a company's fields.


Currently the only operation at the endpoint is `update-fields`, which allows you to update
multiple field values with a single request. This is equivalent to calling [the single field
update](/api-reference/companies/update-a-single-field-value-on-a-company) endpoint multiple times. You can
update up to 100 fields per request.

## Path parameters

- `companyId` integer, required

## Request body

- CompanyBatchOperationRequest — Update multiple field values.
  - `operation` 'update-fields', required
  - `updates` FieldsFieldUpdate[], required
    - `id` string, required — The field's unique identifier.
    - `value` union, required
      - CompaniesValueUpdate
        - `type` 'company-multi', required — The type of value
        - `data` CompanyReference[], nullable, required — The values for many companies
          - `id` integer, required — The company's unique identifier
      - CompanyValueUpdate
        - `type` 'company', required — The type of value
        - `data` CompanyReference, required
          - `id` integer, required — The company's unique identifier
      - DateValue
        - `type` 'datetime', required — The type of value
        - `data` string, date-time, nullable, required — The value for a date
      - DropdownValueUpdate
        - `type` 'dropdown', required — The type of value
        - `data` DropdownReference, required
          - `dropdownOptionId` integer, required — Dropdown item's unique identifier
      - DropdownsValueUpdate
        - `type` 'dropdown-multi', required — The type of value
        - `data` DropdownReference[], nullable, required — The value for many dropdown items
          - `dropdownOptionId` integer, required — Dropdown item's unique identifier
      - FloatValue
        - `type` 'number', required — The type of value
        - `data` number, nullable, required — The value for a number
      - FloatsValue
        - `type` 'number-multi', required — The type of value
        - `data` number[], nullable, required — The value for many numbers
        - `totalCount` integer — The total number of values for this field. When totalCount exceeds the length of data, additional values can be retrieved using the field values endpoint.
      - LocationValue
        - `type` 'location', required — The type of value
        - `data` Location, required
          - `streetAddress` string, nullable, required — Street address
          - `city` string, nullable, required — City
          - `state` string, nullable, required — State
          - `country` string, nullable, required — Country
          - `continent` string, nullable, required — Continent
      - LocationsValue
        - `type` 'location-multi', required — The type of value
        - `data` Location[], nullable, required — The values for many locations
          - `streetAddress` string, nullable, required — Street address
          - `city` string, nullable, required — City
          - `state` string, nullable, required — State
          - `country` string, nullable, required — Country
          - `continent` string, nullable, required — Continent
        - `totalCount` integer — The total number of values for this field. When totalCount exceeds the length of data, additional values can be retrieved using the field values endpoint.
      - PersonValueUpdate
        - `type` 'person', required — The type of value
        - `data` PersonReference, required
          - `id` integer, required — The persons's unique identifier
      - PersonsValueUpdate
        - `type` 'person-multi', required — The type of value
        - `data` PersonReference[], nullable, required — The values for many persons
          - `id` integer, required — The persons's unique identifier
      - RankedDropdownValueUpdate
        - `type` 'ranked-dropdown', required — The type of value
        - `data` RankedDropdownReference, required
          - `dropdownOptionId` integer, required — Ranked Dropdown item's unique identifier
      - TextValue
        - `type` 'filterable-text' | 'text', required — The type of value
        - `data` string, nullable, required — The value for a string
      - TextsValue
        - `type` 'filterable-text-multi', required — The type of value
        - `data` string[], nullable, required — The value for many strings
        - `totalCount` integer — The total number of values for this field. When totalCount exceeds the length of data, additional values can be retrieved using the field values endpoint.

## Response `200`

OK

- CompanyBatchOperationResponse — The response body for a single operation within a company batch request.
  - `operation` 'update-fields' — The set of supported batch operation types for companies.

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `404` — Not Found
- `default` — Errors

---

[API](https://skmtc.net/affinity/apis/affinity-api-v2.md) · [All operations](https://skmtc.net/affinity/apis/affinity-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/affinity/affinity-api-v2/revisions/4c2891c31b7f/schema)
