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

# Fetch custom field

> Fetches a custom field, with the module of Aira that owns it.

Requires the role `custom_fields:read`.



## OpenAPI

````yaml /api-reference/openapi.yaml get /v1/custom-fields/{id}
openapi: 3.1.0
info:
  title: API Reference
  version: '1.0'
  description: Aira API Reference
  x-logo:
    url: https://static.useaira.com/images/airalogo.svg
    backgroundColor: '#FFFFFF'
    altText: Aira Logo
servers:
  - url: https://api.useaira.com
    description: API base URL
security:
  - ApiKey: []
paths:
  /v1/custom-fields/{id}:
    get:
      tags:
        - Custom Fields
      summary: Fetch custom field
      description: |-
        Fetches a custom field, with the module of Aira that owns it.

        Requires the role `custom_fields:read`.
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: id
          required: true
          description: The unique identifier of the custom field.
      responses:
        '200':
          description: >-
            A custom field: a field that you add to one kind of record, such as
            customers or contracts, whose value users fill in on each record.
            Each record of that kind holds the value in its `customFields`,
            under the `fieldKey`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    description: The unique identifier of the custom field.
                  entity:
                    type: string
                    enum:
                      - contract
                      - product
                      - item
                      - customer
                      - importable_template
                      - legal_entity
                      - revenue_traceability
                      - revenue_attribution
                      - invoice_discount
                      - invoice
                      - plan_instance_version
                    description: >-
                      The kind of record that the custom field belongs to, such
                      as `customer` or `contract`.
                  fieldKey:
                    type: string
                    description: >-
                      The key under which each record of the `entity` holds the
                      value of the custom field in its `customFields`. No other
                      custom field of the same `entity` has it.
                    example: canalDeVenda
                  dataType:
                    type: string
                    enum:
                      - string
                      - string_array
                      - boolean
                    description: >-
                      The type of the value of the custom field: `string` holds
                      one text, `string_array` holds a list of texts, and
                      `boolean` holds the text `true` or `false`.
                  label:
                    type: string
                    minLength: 1
                    description: The name of the custom field that the billing app shows.
                    example: Canal de venda
                  description:
                    type:
                      - 'null'
                      - string
                    description: >-
                      The help text that the billing app shows with the input of
                      the custom field, or null for none.
                    example: Canal pelo qual o cliente compra.
                  required:
                    type: boolean
                    description: >-
                      Whether each record of the `entity` must hold a value of
                      the custom field.
                  defaultValue:
                    type:
                      - 'null'
                      - string
                    description: >-
                      The value that the billing app fills in on a new record,
                      or null for none.
                    example: varejo
                  options:
                    type:
                      - 'null'
                      - array
                    items:
                      type: object
                      description: A value that a record can hold in the custom field.
                      properties:
                        label:
                          type: string
                          minLength: 1
                          description: The text that the billing app shows for the option.
                          examples:
                            - Varejo
                        value:
                          type: string
                          minLength: 1
                          description: >-
                            The value that a record holds in its `customFields`
                            when a user picks the option.
                          examples:
                            - varejo
                      required:
                        - label
                        - value
                      additionalProperties: false
                    description: >-
                      The values that a record can hold in the custom field, in
                      the order that the billing app shows them, or null when
                      the custom field takes any value.
                  dataSource:
                    type:
                      - 'null'
                      - string
                    enum:
                      - customers
                      - omie_categories
                      - omie_bank_accounts
                      - null
                    description: >-
                      The records whose ids a record holds in the custom field,
                      in place of `options`: `customers` for the customers, and
                      `omie_categories` or `omie_bank_accounts` for the
                      categories or the bank accounts of Omie. Null when the
                      custom field takes no records.
                  multiline:
                    type: boolean
                    description: >-
                      Whether the billing app shows the input of the custom
                      field as a text area of several lines, in place of a text
                      input of one line. Only a custom field of `string` with no
                      `options` and no `dataSource` is multiline.
                  module:
                    type:
                      - 'null'
                      - string
                    enum:
                      - omie
                      - senior
                      - celcash
                      - asaas
                      - enotas
                      - hubspot
                      - contaazul
                      - null
                    description: >-
                      The module of Aira that owns the custom field, such as the
                      integration `omie`, which reads its value by the
                      `fieldKey`, or null when no module owns it. You cannot
                      update or delete a custom field that a module owns.
                required:
                  - id
                  - entity
                  - fieldKey
                  - dataType
                  - label
                  - description
                  - required
                  - defaultValue
                  - options
                  - dataSource
                  - multiline
                  - module
                additionalProperties: false
        '400':
          description: >-
            The request cannot succeed as sent.


            - `json_schema_validation_error`: a path parameter breaks the schema
            of the endpoint.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - json_schema_validation_error
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                json_schema_validation_error:
                  value:
                    message: '''id'' must match format "uuid"'
                    code: json_schema_validation_error
        '401':
          description: >-
            The request carries no API key.


            - `no_authorization`: the request carries no API key in the
            `X-API-KEY` header.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - no_authorization
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                no_authorization:
                  value:
                    message: No authorization provided
                    code: no_authorization
        '403':
          description: >-
            The API key cannot call the endpoint.


            - `bad_auth`: the API key does not hold the role that the endpoint
            requires.

            - `invalid_api_key`: the API key does not exist.

            - `deactivated_api_key`: the API key is deactivated.

            - `revoked_api_key`: the API key is revoked.

            - `expired_api_key`: the API key is past its expiry date.

            - `ip_not_allowed`: the IP of the request is not among the IPs that
            your API keys accept.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - bad_auth
                      - invalid_api_key
                      - deactivated_api_key
                      - revoked_api_key
                      - expired_api_key
                      - ip_not_allowed
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                bad_auth:
                  value:
                    message: role custom_fields:read can not be satisfied
                    code: bad_auth
                invalid_api_key:
                  value:
                    message: Invalid API key
                    code: invalid_api_key
                deactivated_api_key:
                  value:
                    message: Deactivated API key
                    code: deactivated_api_key
                revoked_api_key:
                  value:
                    message: Revoked API key
                    code: revoked_api_key
                expired_api_key:
                  value:
                    message: Expired API key
                    code: expired_api_key
                ip_not_allowed:
                  value:
                    message: IP not allowed
                    code: ip_not_allowed
        '404':
          description: |-
            A record that the request names does not exist.

            - `custom_field_not_found`: no custom field has the `id`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - custom_field_not_found
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                custom_field_not_found:
                  value:
                    message: custom field "{id}" not found
                    code: custom_field_not_found
        '429':
          description: >-
            You reached one of the limits of reads, which count the reads of all
            your API keys together.


            - `too_many_reads_per_second`: you already made 50 reads in this
            second across all your API keys.

            - `too_many_reads_in_flight`: you already have 20 reads in flight
            across all your API keys.
          headers:
            Retry-After:
              schema:
                type: integer
              description: The seconds to wait before the next read.
            RateLimit-Limit:
              schema:
                type: integer
              description: >-
                The limit that the read hit: 20 for the reads in flight, 50 for
                the reads per second.
            RateLimit-Remaining:
              schema:
                type: integer
              description: The reads left under that limit, which is 0.
            RateLimit-Reset:
              schema:
                type: integer
              description: >-
                The seconds to wait before the next read, as in Retry-After. The
                limit of reads per second takes new reads in the next second,
                but the limit of reads in flight takes a new read only once one
                of the reads in flight ends.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - too_many_reads_per_second
                      - too_many_reads_in_flight
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                too_many_reads_per_second:
                  value:
                    message: >-
                      Too many reads: you can make at most 50 reads per second
                      across all your API keys. Retry after 1 second.
                    code: too_many_reads_per_second
                too_many_reads_in_flight:
                  value:
                    message: >-
                      Too many reads in flight: you can have at most 20 reads in
                      flight across all your API keys. Retry after 1 second.
                    code: too_many_reads_in_flight
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      description: API Key Authentication.
      name: X-API-KEY
      in: header

````

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