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

# Create custom field

> Creates a custom field for contacts or companies



## OpenAPI

````yaml /developers/openapi.yaml post /v1/custom-fields
openapi: 3.0.3
info:
  title: TalkToHumans Public API
  version: 1.0.0
  license:
    name: Proprietary
  description: >
    Read and organize the LinkedIn organization data your team already manages
    in TalkToHumans: accounts, contacts, tags, notes, custom fields, sequence
    state, conversations, templates, and views.
servers:
  - url: https://api.talktohumans.app
    description: TalkToHumans API
security:
  - bearerAuth: []
tags:
  - name: Organization
    description: Organization details for the current API key.
  - name: LinkedIn
    description: LinkedIn accounts, contacts, companies, and conversations.
  - name: Activity
    description: Activity for organization reporting.
  - name: Enrich
    description: Profile enrichment for LinkedIn contacts and companies.
  - name: Views
    description: Saved TalkToHumans views.
  - name: Templates
    description: Message and sequence templates.
  - name: Custom fields
    description: Custom fields for contacts and companies.
paths:
  /v1/custom-fields:
    post:
      tags:
        - Custom fields
      summary: Create custom field
      description: Creates a custom field for contacts or companies
      operationId: createCustomField
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCustomFieldRequest'
            examples:
              contact:
                summary: Create a contact field
                value:
                  name: ICP score
                  field_type: number
              company:
                summary: Create a company field
                value:
                  name: Target account
                  field_type: boolean
                  object_type: company
      responses:
        '201':
          description: Custom field created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomFieldEnvelope'
              example:
                data:
                  custom_field:
                    id: 8f3a2c1d4b5e4f6a9b7c0d1e2f3a4b5c
                    name: ICP score
                    field_type: number
                    object_type: contact
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/AdminForbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    CreateCustomFieldRequest:
      type: object
      additionalProperties: false
      required:
        - name
        - field_type
      properties:
        name:
          type: string
          minLength: 1
          description: Field name shown in TalkToHumans. Must be unique per object type.
        field_type:
          type: string
          description: Value type. It can't be changed later.
          enum:
            - text
            - number
            - boolean
            - date
        object_type:
          type: string
          enum:
            - contact
            - company
          default: contact
    CustomFieldEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/CustomFieldResponse'
    CustomFieldResponse:
      type: object
      additionalProperties: false
      required:
        - custom_field
      properties:
        custom_field:
          $ref: '#/components/schemas/CustomField'
    Error:
      type: object
      additionalProperties: false
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Machine-readable error code.
          enum:
            - unauthorized
            - forbidden
            - not_found
            - bad_request
            - internal_error
            - conflict
            - rate_limit_exceeded
            - account_shared_access_required
            - billing_payment_failed
            - billing_subscription_incomplete
            - billing_subscription_expired
            - billing_grace_period
            - billing_feature_not_available
            - billing_insufficient_credits
            - billing_invalid
            - enrichment_failed
            - enrichment_in_progress
            - linkedin_profile_not_found
        message:
          type: string
          description: Human-readable error message.
        debug:
          type: string
          description: Development-only debug details.
    CustomField:
      type: object
      additionalProperties: false
      required:
        - id
        - name
        - field_type
        - object_type
      properties:
        id:
          type: string
          description: Custom field ID.
        name:
          type: string
          description: >-
            Key used in contact and company updates, as `custom_fields.<name>`
            in filters, and as a top-level response property.
        field_type:
          type: string
          description: >-
            Text fields hold strings, number fields numbers, boolean fields
            booleans, and date fields `YYYY-MM-DD` strings.
          enum:
            - text
            - number
            - boolean
            - date
        object_type:
          type: string
          enum:
            - contact
            - company
  responses:
    BadRequest:
      description: Invalid request. `message` explains what to fix.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: bad_request
            message: invalid type for field "account_id"
    Unauthorized:
      description: Missing, malformed, invalid, or retired local API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missingAuthorization:
              value:
                code: unauthorized
                message: Authorization header is required
            invalidAuthorizationFormat:
              value:
                code: unauthorized
                message: Authorization header must use Bearer scheme
            invalidAPIKey:
              value:
                code: unauthorized
                message: Invalid API key
    AdminForbidden:
      description: >-
        API access is not enabled for the organization, the API key cannot
        resolve to an active organization user, or the credential's user is not
        an organization admin.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            adminRequired:
              summary: Requires an organization admin API-key principal
              value:
                code: forbidden
                message: Only organization admins can perform this action.
            forbidden:
              value:
                code: forbidden
                message: you don't have access to this organization
            featureUnavailable:
              value:
                code: billing_feature_not_available
                message: >-
                  Feature 'TalkToHumansAPI' is not available in your current
                  plan
            insufficientCredits:
              value:
                code: billing_insufficient_credits
                message: Insufficient credits
            apiKeyPrincipalInvalid:
              value:
                code: forbidden
                message: >-
                  This API key is no longer linked to an active organization
                  user. Ask an organization admin to regenerate it
    Conflict:
      description: Request conflicts with an existing resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: conflict
            message: custom field key already exists
    RateLimited:
      description: >-
        Rate limit exceeded. Public routes allow 50 requests per 10 seconds per
        IP and endpoint.
      headers:
        Retry-After:
          description: Seconds to wait before retrying the request.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: rate_limit_exceeded
            message: Rate limit exceeded
    InternalServerError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: internal_error
            message: An internal error occurred
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Pass API key as `Authorization: Bearer <api_key>`.'

````

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