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

# List Entities

> Returns a paginated list of `{entityType}` entities. One parametric endpoint
serves all six CRUD entity types.

**Free-text search** (`filterText`) matches the entity's configured display
field (e.g. `exposureName`, `submissionNumber`/`submissionName`).

**Field-value filtering** (`filters`) narrows the list server-side by any
configured field value — use it to look an entity up by a business key
instead of paging the whole collection. It accepts the same JSON-encoded
filter array as the
[List Policies](/api-reference/policies/list-policies) endpoint.

**Sorting** is config-driven — `sortBy` accepts `createdAt` (default),
`updatedAt`, or any configured field `referenceId`.

**Pagination** is zero-based (`pageNumber=0` is the first page); `pageSize`
defaults to 51.

**Required permission:** `company.{entity}:read` — the exact key varies by
type. See [Permissions](/api-reference/entities/overview#permissions).




## OpenAPI

````yaml /openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/entities/{entityType}
openapi: 3.0.3
info:
  title: AI Insurance External API
  description: External API for AI Insurance platform
  version: 1.0.0
  contact:
    email: support@aiinsurance.io
servers:
  - url: https://go.aiinsurance.io
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/v1/companies/{companyId}/entities/{entityType}:
    get:
      tags:
        - Entities
      summary: List Entities
      description: >
        Returns a paginated list of `{entityType}` entities. One parametric
        endpoint

        serves all six CRUD entity types.


        **Free-text search** (`filterText`) matches the entity's configured
        display

        field (e.g. `exposureName`, `submissionNumber`/`submissionName`).


        **Field-value filtering** (`filters`) narrows the list server-side by
        any

        configured field value — use it to look an entity up by a business key

        instead of paging the whole collection. It accepts the same JSON-encoded

        filter array as the

        [List Policies](/api-reference/policies/list-policies) endpoint.


        **Sorting** is config-driven — `sortBy` accepts `createdAt` (default),

        `updatedAt`, or any configured field `referenceId`.


        **Pagination** is zero-based (`pageNumber=0` is the first page);
        `pageSize`

        defaults to 51.


        **Required permission:** `company.{entity}:read` — the exact key varies
        by

        type. See [Permissions](/api-reference/entities/overview#permissions).
      operationId: listEntities
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/crudEntityType'
        - $ref: '#/components/parameters/filterText'
        - $ref: '#/components/parameters/entityFilters'
        - $ref: '#/components/parameters/sortByField'
        - $ref: '#/components/parameters/sortDirection'
        - $ref: '#/components/parameters/pageNumber'
        - $ref: '#/components/parameters/pageSize'
      responses:
        '200':
          description: Paginated list of entities
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/FieldModelV1Entity'
                  hasMore:
                    type: boolean
                    description: Whether more pages exist after this one
                  totalCount:
                    type: integer
                    description: Total number of matching records across all pages
              examples:
                success:
                  summary: List of entities
                  value:
                    items:
                      - id: 550e8400-e29b-41d4-a716-446655440301
                        fieldModelV1Data:
                          exposureName: Acme Corp HQ
                        createdAt: 1736937000
                        createdBy: google-oauth2|123456789
                        updatedAt: 1736937000
                        updatedBy: null
                        createdByName: Jane Adjuster
                        updatedByName: null
                    hasMore: false
                    totalCount: 1
                emptyList:
                  summary: No entities found
                  value:
                    items: []
                    hasMore: false
                    totalCount: 0
        '400':
          description: Bad Request - Invalid query parameter
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalidFiltersJson:
                  summary: Malformed filters JSON
                  value:
                    error:
                      code: INVALID_REQUEST
                      message: filters must be valid JSON
                      userMessages:
                        - filters must be valid JSON
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    companyId:
      name: companyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Company identifier
    crudEntityType:
      name: entityType
      in: path
      required: true
      schema:
        type: string
        enum:
          - event
          - exposure
          - quote
          - submission
          - person
          - organization
      description: >
        Field Model V1 entity type (lowercase kebab-case URL slug). One of the
        six

        CRUD entity types: `event`, `exposure`, `quote`, `submission`, `person`,

        `organization`. `policy` is NOT valid here — Policy has no generic CRUD
        (its

        writes go through the policy transaction endpoints), though it does have
        a

        read-only `/configuration` schema.
    filterText:
      name: filterText
      in: query
      schema:
        type: string
      description: Search across quote number, description, and other text fields
    entityFilters:
      name: filters
      in: query
      schema:
        type: string
      description: >
        JSON-encoded array of field filters applied **server-side** against the

        entity's `fieldModelV1Data`. Use this to look an entity up by a business
        key

        (e.g. a document ID or any configured field value) instead of paging the
        whole

        collection and matching client-side. Complements `filterText`, which
        only

        searches the configured display field.


        Each filter is `{ fieldReferenceId, fieldType, operator, value }` and
        supports

        type-specific operators. Supported field types: `text`, `number`,
        `boolean`,

        `date`, `currency`, `optionSet`, `address`, `join`, `textList`,
        `numberList`,

        `optionSetList`, `addressList`. This is the same filter shape the

        [List Policies](/api-reference/policies/list-policies) endpoint accepts.


        List-cardinality types support operators: `listIncludes` (textList,
        numberList,

        addressList), `listIn`, `listAll`, `listExcludes` (optionSetList).

        The `join` type supports the `in` operator.


        See the Configuration API for available field reference IDs.
      examples:
        textFilter:
          summary: Text field filter (look up by business key)
          value: >-
            [{"fieldReferenceId":"exposureName","fieldType":"text","operator":"matches","value":"Acme
            Corp HQ"}]
        optionSetFilter:
          summary: Option-set field filter
          value: >-
            [{"fieldReferenceId":"exposureType","fieldType":"optionSet","operator":"in","value":["company"]}]
    sortByField:
      name: sortBy
      in: query
      schema:
        type: string
        default: createdAt
      description: >
        Field to sort by. Accepts `createdAt`, `updatedAt`, or any configured
        field

        `referenceId` for the entity type (sorting is config-driven). Default
        `createdAt`.
    sortDirection:
      name: sortDirection
      in: query
      schema:
        type: string
        enum:
          - asc
          - desc
        default: desc
      description: Sort direction (default desc)
    pageNumber:
      name: pageNumber
      in: query
      schema:
        type: integer
        minimum: 0
        default: 0
      description: Zero-based page index (default 0).
    pageSize:
      name: pageSize
      in: query
      schema:
        type: integer
        minimum: 1
        default: 51
      description: Number of records per page (default 51).
  schemas:
    FieldModelV1Entity:
      type: object
      description: >
        The generic shape returned by unified entity get and list endpoints. All

        entity-specific field values live inside `fieldModelV1Data` (keyed by
        field

        `referenceId`); the envelope is identical for every entity type.
      properties:
        id:
          type: string
          format: uuid
          description: Entity identifier
        fieldModelV1Data:
          type: object
          additionalProperties: true
          description: >
            Field values keyed by `referenceId`. Includes calculated/auto-set
            values

            populated by the resolver (e.g. `submissionNumber`, `quoteStatus`)
            and

            join field IDs.
        createdAt:
          type: integer
          format: int64
          description: Creation time in epoch seconds.
        createdBy:
          type: string
          nullable: true
          description: User ID of the creator, or null.
        updatedAt:
          type: integer
          format: int64
          description: >-
            Last update time in epoch seconds (equals `createdAt` if never
            updated).
        updatedBy:
          type: string
          nullable: true
          description: User ID of the last updater, or null.
        createdByName:
          type: string
          nullable: true
          description: Display name resolved from `createdBy`, or null.
        updatedByName:
          type: string
          nullable: true
          description: Display name resolved from `updatedBy`, or null.
      required:
        - id
        - fieldModelV1Data
        - createdAt
        - createdBy
        - updatedAt
        - updatedBy
        - createdByName
        - updatedByName
    ErrorResponse:
      type: object
      description: Standard error response for all external API endpoints
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable error code
              example: VALIDATION_ERROR
            message:
              type: string
              description: Human-readable error message
              example: 'submissionId: Required field is missing'
            userMessages:
              type: array
              description: >-
                Clean, verbatim-displayable messages — one entry per failure,
                free of error-code tags, field paths, and internal noise.
                Suitable for showing to end users as-is.
              items:
                type: string
              example:
                - Exposures of type 'company' require an address
            details:
              type: array
              description: Additional details for validation errors (field-level errors)
              items:
                type: object
                properties:
                  field:
                    type: string
                    description: The field that caused the error
                    example: submissionId
                  message:
                    type: string
                    description: Description of the field error
                    example: Required field is missing
  responses:
    Unauthorized:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingApiKey:
              summary: Missing API key
              value:
                error:
                  code: AuthenticationError
                  message: API key authentication required
                  userMessages:
                    - API key authentication required
            invalidApiKey:
              summary: >-
                Invalid API key (e.g. unknown key, or a Bearer token used
                instead of an API key)
              value:
                error:
                  code: AuthenticationError
                  message: Invalid API key
                  userMessages:
                    - Invalid API key
    Forbidden:
      description: Forbidden - Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            insufficientPermissions:
              summary: Insufficient permissions
              value:
                error:
                  code: AuthorizationError
                  message: User is not authorized to perform the requested action
                  userMessages:
                    - User is not authorized to perform the requested action
            companyMismatch:
              summary: A valid API key naming another company in the URL
              value:
                error:
                  code: AuthorizationError
                  message: API key is not scoped to the requested company
                  userMessages:
                    - API key is not scoped to the requested company
    InternalServerError:
      description: Internal Server Error - Unexpected error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internalError:
              summary: Unexpected server error
              value:
                error:
                  code: UncaughtActionError
                  message: Uncaught error occurred in <actionName>
                  userMessages:
                    - An unexpected error occurred. Please try again later.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Send your raw API key as the `Authorization`
        header value with NO scheme prefix — `Authorization: YOUR-API-KEY`. Do
        NOT prefix it with `Bearer ` or `ApiKey `, and do not use an `X-API-Key`
        header; those are not accepted.

````