---
title: "Get metadata on Company Fields"
method: GET
path: "/v2/companies/fields"
tags: ["Companies"]
---

# Get metadata on Company Fields

`GET /v2/companies/fields`

Returns metadata on non-list-specific Company Fields.

Use the returned Field IDs to request field data from the GET `/v2/companies` and GET `/v2/companies/{id}` endpoints.

You can filter Fields using the `filter` query parameter. The filter parameter is a string that you can specify conditions based on the following properties.
| **Property Name** | **Type** | **Allowed Operators** | **Examples** |
|---|---|---|---|
| `name` | `text` | `=`, `=~` | `name="Location"`, `name=~loc` |

Use the `includes` query parameter to add optional metadata to each Field in the response. Pass `includes` more than once to request multiple values.
| **Value** | **Adds to each Field** |
|---|---|
| `filterability` | How the field can be used in filter expressions on GET `/v2/companies` and POST `/v2/companies/search` |
| `sortability` | How the field can be used in sort expressions on those endpoints |

Example: `GET /v2/companies/fields?includes=filterability&includes=sortability`

## Query parameters

- `cursor` string
- `limit` integer
- `filter` string
- `includes` string[]

## Response `200`

OK

- FieldMetadataPaged — FieldMetadataPaged model
  - `data` FieldMetadata[], required — A page of FieldMetadata results
    - `id` string, required — The field's unique identifier
    - `name` string, required — The field's name
    - `type` 'enriched' | 'global' | 'list' | 'relationship-intelligence', required — The field's type
    - `enrichmentSource` 'affinity-data' | 'dealroom' | 'eventbrite' | 'mailchimp' | 'null', nullable, required — The source of the data in this Field (if it is enriched)
    - `valueType` 'person' | 'person-multi' | 'company' | 'company-multi' | 'filterable-text' | 'filterable-text-multi' | 'number' | 'number-multi' | 'datetime' | 'location' | 'location-multi' | 'text' | 'ranked-dropdown' | 'dropdown' | 'dropdown-multi' | 'formula-number' | 'interaction', required — The type of the data in this Field
    - `createdAt` string, date-time, nullable, required — The date and time this field was created, or `null` for built-in fields that Affinity provides automatically and that therefore have no creation time (for example identity, association, interaction, and some enriched fields).
    - `filterability` union — Describes how a field can be used in filter expressions.
      - FieldFilterabilityFieldOnly — A field that is filtered directly using the field `id` and one of the listed `operators`.
        - `filterableFieldType` 'field-only', required
        - `operators` FilterableFieldOperator[], required — The operators supported for filtering on this field
          - `id` 'contains' | 'does-not-contain' | 'ends-with' | 'has-all-of' | 'has-any-of' | 'has-exactly' | 'has-none-of' | 'is-after' | 'is-any-of' | 'is-before' | 'is-between' | 'is-between-relative' | 'is-empty' | 'is-equal-to' | 'is-exactly' | 'is-exactly-relative' | 'is-greater-than' | 'is-greater-than-or-equal-to' | 'is-less-than' | 'is-less-than-or-equal-to' | 'is-less-than-relative' | 'is-less-than-or-equal-to-relative' | 'is-more-than' | 'is-more-than-or-equal-to' | 'is-more-than-relative' | 'is-more-than-or-equal-to-relative' | 'is-none-of' | 'is-not-empty' | 'is-not-equal-to' | 'is-not-exactly-relative' | 'is-not-on' | 'is-not-within-the-last' | 'is-not-within-the-next' | 'is-on' | 'is-on-or-after' | 'is-on-or-before' | 'is-within-the-last' | 'is-within-the-next' | 'starts-with', required — The operator identifier
          - `name` string, required — Human-readable name for the operator
          - `numberOfValuesRequired` 'none' | 'one' | 'two' | 'multi', required — The number of values required for this operator. `none` means no value is needed (e.g. `is-empty`). `one` means a single value. `two` means a range (e.g. `is-between`). `multi` means one or more values (e.g. `has-any-of`).
          - `relativeDateUnits` string[] — For relative date operators, the list of time units that can be used as the value (e.g. `days`, `weeks`, `months`). Only present on relative date operators.
      - FieldFilterabilityAttributeOnField — A field with sub-attributes that are each filtered independently using the field `id`, an attribute `id`, and an operator from that attribute's `operators` list.
        - `filterableFieldType` 'attribute-on-field', required
        - `attributes` FilterableFieldAttribute[], required — The sub-attributes of this field, each with their own supported operators
          - `id` string, required — The attribute identifier
          - `name` string, required — Human-readable name for the attribute
          - `valueType` 'date' | 'number' | 'person-multi' | 'text', required — The value type of this attribute
          - `operators` FilterableFieldOperator[], required — The operators supported for this attribute
            - `id` 'contains' | 'does-not-contain' | 'ends-with' | 'has-all-of' | 'has-any-of' | 'has-exactly' | 'has-none-of' | 'is-after' | 'is-any-of' | 'is-before' | 'is-between' | 'is-between-relative' | 'is-empty' | 'is-equal-to' | 'is-exactly' | 'is-exactly-relative' | 'is-greater-than' | 'is-greater-than-or-equal-to' | 'is-less-than' | 'is-less-than-or-equal-to' | 'is-less-than-relative' | 'is-less-than-or-equal-to-relative' | 'is-more-than' | 'is-more-than-or-equal-to' | 'is-more-than-relative' | 'is-more-than-or-equal-to-relative' | 'is-none-of' | 'is-not-empty' | 'is-not-equal-to' | 'is-not-exactly-relative' | 'is-not-on' | 'is-not-within-the-last' | 'is-not-within-the-next' | 'is-on' | 'is-on-or-after' | 'is-on-or-before' | 'is-within-the-last' | 'is-within-the-next' | 'starts-with', required — The operator identifier
            - `name` string, required — Human-readable name for the operator
            - `numberOfValuesRequired` 'none' | 'one' | 'two' | 'multi', required — The number of values required for this operator. `none` means no value is needed (e.g. `is-empty`). `one` means a single value. `two` means a range (e.g. `is-between`). `multi` means one or more values (e.g. `has-any-of`).
            - `relativeDateUnits` string[] — For relative date operators, the list of time units that can be used as the value (e.g. `days`, `weeks`, `months`). Only present on relative date operators.
    - `sortability` union — Describes how a field can be used in sort expressions.
      - FieldSortabilityFieldOnly — A field that is sorted directly by its value. Use the field `id` as `fieldId` in sort expressions.
        - `sortableFieldType` 'field-only', required
      - FieldSortabilityAttributeOnField — A field with sub-attributes that can each be sorted on independently using the field `id` and an attribute `id`.
        - `sortableFieldType` 'attribute-on-field', required
        - `attributes` FieldSortabilityAttribute[], required — The sub-attributes that can be sorted on
          - `id` string, required — The attribute identifier
          - `name` string, required — Human-readable name for the attribute
          - `valueType` 'company-multi' | 'date' | 'number' | 'person' | 'person-multi' | 'ranked-dropdown' | 'text', required — The value type of this attribute
  - `pagination` Pagination, required
    - `prevUrl` string, uri, nullable — URL for the previous page
    - `nextUrl` string, uri, nullable — URL for the next page

## Other responses

- `400` — Bad Request
- `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)
