> ## Documentation Index
> Fetch the complete documentation index at: https://docs.serval.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Entity Type Field Distinct Values

> List the values a filter on one field of an entity type can take: the distinct values in use for a text, unique or entity reference field, or every option of an enum or multi-select field. Use it to find the exact stored value before filtering, because a text filter compares against the stored text and a guessed value matches nothing. The list covers the entity type's own records, not those of its child types; list a child type separately. List without search first; pass search, a case-insensitive match on text fields, only when the list runs past one page.

## Authentication and permissions

> **Token requirements:** **User-based token (OAuth)** or **Organization-scoped API key** or **Workspace-scoped API key**.
>
> Send a bearer access token for one of these identities. The permissions and resource restrictions below also apply.

| Credential | Access requirements |
| - | - |
| Organization-scoped API key | `entities:read` |
| Workspace-scoped API key | `entities:read` |
| User-based token (OAuth) | Supported, subject to permissions |

Permissions joined by **+** are all required; **or** separates alternatives. Full-access keys still cannot call endpoints marked unsupported. Workspace keys must allow every workspace checked by the request. OAuth access depends on the user’s roles and resource access.

* **Read the values of a field in a workspace's database, or in a database shared with one of your workspaces:** The permission is checked on the entity type's owning workspace, or on a workspace its database is shared with ("Can read" or "Can write"). An entity type the caller cannot reach reads as not found. Schema, field and row-access rules still apply: a hidden or sensitive field is refused, and so is a caller limited to some of the type's records when the field is a text, unique or entity reference field.


## OpenAPI

````yaml /sections/api-reference/openapi-spec-v2.yaml get /v2/entity-types/{entity_type_id}/fields/{field_key}/distinct-values
openapi: 3.1.0
info:
  title: Serval Public API
  description: Serval Public API
  contact:
    name: Serval
    url: https://serval.com
    email: support@serval.com
  license:
    name: Serval License
    url: https://serval.com/license
  version: 2.0.0
servers:
  - url: https://public.api.serval.com
security:
  - BearerAuth: []
tags:
  - name: Access Membership API
  - name: Access Policy API
  - name: Access Policy Approval Procedure API
  - name: Access Profile API
  - name: Access Relationship API
  - name: Access Request API
  - name: Agent API
  - name: Alerts API
  - name: Analytics API
  - name: App Instance API
  - name: App Resource API
  - name: App Resource Role API
  - name: Approval Delegation API
  - name: Approval Procedure API
  - name: Approval Request API
  - name: Assignment Rules API
  - name: Audit Log API
  - name: Billing API
  - name: Browser API
  - name: Campaign API
  - name: Change Blackout API
  - name: Change Model API
  - name: Connected Channels API
  - name: Custom Field API
  - name: Custom Role API
  - name: Custom Service API
  - name: Dashboards API
  - name: Email Intake API
  - name: Entity API
  - name: Entity Field Mapping API
  - name: Entity Ingestion Config API
  - name: Entity Type API
  - name: Folder API
  - name: Forms API
  - name: Group API
  - name: Guidance API
  - name: Help Agent API
  - name: Improvement Request API
  - name: Journey API
  - name: Knowledge API
  - name: Knowledge Base API
  - name: One-Time Window API
  - name: Package API
  - name: Platform Migration API
  - name: Project API
  - name: Report API
  - name: Review API
  - name: Role Sync API
  - name: Roles API
  - name: SLA API
  - name: Schedule API
  - name: Skills API
  - name: Tag API
  - name: Ticket API
  - name: Ticket Import API
  - name: Ticket Type API
  - name: Topic API
  - name: User API
  - name: User Relationship API
  - name: Widgets API
  - name: Worker API
  - name: Workflow API
  - name: Workflow Approval Procedure API
  - name: Workflow Run API
  - name: Workspace API
  - name: Workspace Group API
  - name: Workspace SDLC Settings API
  - name: Workspace User API
paths:
  /v2/entity-types/{entity_type_id}/fields/{field_key}/distinct-values:
    get:
      tags:
        - Entity Type API
      summary: List Entity Type Field Distinct Values
      description: >-
        List the values a filter on one field of an entity type can take: the
        distinct values in use for a text, unique or entity reference field, or
        every option of an enum or multi-select field. Use it to find the exact
        stored value before filtering, because a text filter compares against
        the stored text and a guessed value matches nothing. The list covers the
        entity type's own records, not those of its child types; list a child
        type separately. List without search first; pass search, a
        case-insensitive match on text fields, only when the list runs past one
        page.
      operationId: svrelay.publicv2.PublicAPIServiceV2.ListEntityTypeFieldDistinctValues
      parameters:
        - name: entity_type_id
          in: path
          required: true
          schema:
            type: string
            title: entity_type_id
            description: >-
              The ID of the entity type. Readable in its owning workspace or
              through
               a workspace its database is shared with; an entity type the caller
               cannot reach reads as not found.
        - name: field_key
          in: path
          required: true
          schema:
            type: string
            title: field_key
            description: >-
              The key of a TEXT, UNIQUE, ENUM, MULTI_SELECT, BOOL or ENTITY_REF
              field
               on that entity type. A field whose values are hidden from the caller,
               or a sensitive field, is refused.
        - name: search
          in: query
          schema:
            type: string
            title: search
            description: >-
              Optional: narrows a TEXT field's values to those containing this
              text,
               ignoring case. Other field types ignore it. Costs more than a plain
               listing; use it when the listing runs past one page.
        - name: pageSize
          in: query
          schema:
            type: integer
            title: page_size
            format: int32
            description: >-
              Maximum number of values to return. Default is 100, maximum is
              1000.
               The options of an ENUM or MULTI_SELECT field always come back whole.
        - name: pageToken
          in: query
          schema:
            type: string
            title: page_token
            description: Token for pagination. Leave empty for the first request.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/svstore.publicapi.ListEntityTypeFieldDistinctValuesResponse
      security:
        - BearerAuth: []
components:
  schemas:
    svstore.publicapi.ListEntityTypeFieldDistinctValuesResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: >-
              #/components/schemas/svstore.publicapi.EntityTypeFieldDistinctValue
          title: data
          description: >-
            TEXT, UNIQUE and ENTITY_REF fields list the distinct values in use,
            in
             order; ENUM and MULTI_SELECT fields list every option. The values are
             those of this entity type's own records, archived ones included, not
             of its child types. For those three field types a caller whose access
             to the entity type is limited to some of its records is refused: no
             value could be tied to a record the caller may read.
          x-stainless-terraform-configurability: optional
        nextPageToken:
          type:
            - string
            - 'null'
          title: next_page_token
          description: |-
            Token for retrieving the next page of results. Empty if no more
             results. A page can hold fewer values than page_size, even none, while
             more remain; keep paging while this is set.
          x-stainless-terraform-configurability: optional
      title: ListEntityTypeFieldDistinctValuesResponse
      additionalProperties: false
    svstore.publicapi.EntityTypeFieldDistinctValue:
      type: object
      properties:
        value:
          type: string
          title: value
          description: >-
            TEXT and UNIQUE: the stored text. ENUM and MULTI_SELECT: the
            option's
             value. BOOL: "true" or "false". ENTITY_REF: the referenced entity's ID.
          x-stainless-terraform-configurability: optional
        label:
          type:
            - string
            - 'null'
          title: label
          description: |-
            What to show for the value when that differs from it: an option's
             display name, a referenced entity's name.
          x-stainless-terraform-configurability: optional
      title: EntityTypeFieldDistinctValue
      additionalProperties: false
      description: A value a SearchEntities filter on the field can take.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.