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

# Create a contact

> Creates a contact for the agent. Name handling follows the Dashboard:
send `salutation`/`first_name`/`last_name` and `customer_name` is
composed from them (`name_parsed: manual`); send only `customer_name`
and it is split automatically where unambiguous (`auto`), otherwise the
full name is kept in `last_name` with `name_parsed: unclear` — the voice
agent only greets contacts by name when `name_parsed` is not `unclear`.
`phone_number` (the number the agent matches callers against) is derived
from `mobile_number` (preferred) or `landline_number` when either is sent.
All numbers must be E.164. `name_source` is set to `manual`.




## OpenAPI

````yaml post /v1/agents/{agentId}/contacts
openapi: 3.1.0
info:
  title: TalkPilot API
  version: 1.0.0
  description: >
    The TalkPilot API allows you to programmatically manage your call center
    agents,

    employees, forwarding slots, knowledge base, and more.


    ## Authentication


    All API requests require an API key passed via the `X-API-Key` header:


    ```

    X-API-Key: tp_live_abc123def456...

    ```


    An API key can reach every organization its creator is a member of (see

    `GET /v1/organization`) and can be restricted to specific agents and
    permissions.

    Create and manage keys in the TalkPilot Dashboard under **Settings > API**

    (Dev-Admin only).


    ## Rate Limiting


    Default limits per API key: **60 requests/minute** and **1,000
    requests/hour**

    (both enforced, both configurable per key).


    Rate limit headers are included in every response to a request authenticated

    with an API key (Dashboard JWT requests are not rate limited):

    - `X-RateLimit-Limit` — Max requests per minute

    - `X-RateLimit-Remaining` — Remaining requests in the current minute window

    - `X-RateLimit-Reset` — Unix timestamp roughly 60 seconds in the future


    When rate limited, the API returns `429 Too Many Requests` with
    `Retry-After: 60`

    (minute window) or `Retry-After: 3600` (hour window).


    ## Pagination


    List endpoints support pagination via query parameters:

    - `page` — Page number (default: 1)

    - `limit` — Items per page (default: 20, max: 100)


    Paginated responses include a `pagination` object with `page`, `limit`,
    `total`, and `pages`.


    ## Error Format


    All errors follow a consistent format:


    ```json

    {
      "error": {
        "code": "VALIDATION_ERROR",
        "message": "Human-readable description",
        "details": [{ "field": "name", "message": "Required" }],
        "request_id": "req_abc123"
      }
    }

    ```
  contact:
    name: TalkPilot Support
    email: support@talkpilot.io
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://api.talkpilot.io
    description: Production
security:
  - apiKey: []
tags:
  - name: Health
    description: API health and status
  - name: Agents
    description: Manage AI agent configurations
  - name: Workflow
    description: Multi-state conversation flow of an agent
  - name: Tools
    description: Manage agent tools (HTTP requests, call transfers, etc.)
  - name: Employees
    description: Manage employees linked to agents
  - name: Contacts
    description: >-
      Customer contacts (customer_database) per agent — the voice agent
      recognises callers and greets them by name or tag from here
  - name: Forwarding Slots
    description: Manage call forwarding slot assignments
  - name: Knowledge Base
    description: Manage agent knowledge base documents
  - name: Calls
    description: Read call records and transcripts
  - name: Organization
    description: Organization-level settings
  - name: API Keys
    description: Manage API keys (Dashboard JWT auth only; dev_admin)
paths:
  /v1/agents/{agentId}/contacts:
    post:
      tags:
        - Contacts
      summary: Create a contact
      description: >
        Creates a contact for the agent. Name handling follows the Dashboard:

        send `salutation`/`first_name`/`last_name` and `customer_name` is

        composed from them (`name_parsed: manual`); send only `customer_name`

        and it is split automatically where unambiguous (`auto`), otherwise the

        full name is kept in `last_name` with `name_parsed: unclear` — the voice

        agent only greets contacts by name when `name_parsed` is not `unclear`.

        `phone_number` (the number the agent matches callers against) is derived

        from `mobile_number` (preferred) or `landline_number` when either is
        sent.

        All numbers must be E.164. `name_source` is set to `manual`.
      operationId: createContact
      parameters:
        - $ref: '#/components/parameters/AgentId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactCreate'
            examples:
              withParts:
                summary: Name parts (greeted by name)
                value:
                  salutation: Herr
                  last_name: Fey
                  mobile_number: '+491711234567'
                  email: fey@example.com
                  company: Fey GmbH
                  tags:
                    - vip
              displayNameOnly:
                summary: Display name only (split automatically)
                value:
                  customer_name: Tobias Lutz
                  landline_number: '+492215550'
      responses:
        '201':
          description: Contact created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    AgentId:
      name: agentId
      in: path
      required: true
      description: Agent UUID
      schema:
        type: string
        format: uuid
  schemas:
    ContactCreate:
      type: object
      description: >
        All fields optional. Either send name parts (`salutation`, `first_name`,

        `last_name`) or a `customer_name` to split automatically. Numbers must
        be

        E.164 (`+4922112345678`); `phone_number` is derived from

        `mobile_number`/`landline_number` when either is present.
      properties:
        customer_name:
          type:
            - string
            - 'null'
        salutation:
          type:
            - string
            - 'null'
        first_name:
          type:
            - string
            - 'null'
        last_name:
          type:
            - string
            - 'null'
        phone_number:
          type:
            - string
            - 'null'
          description: Only needed when neither mobile_number nor landline_number is sent
        mobile_number:
          type:
            - string
            - 'null'
        landline_number:
          type:
            - string
            - 'null'
        email:
          type:
            - string
            - 'null'
          format: email
        address:
          type:
            - string
            - 'null'
        company:
          type:
            - string
            - 'null'
        tags:
          type:
            - array
            - 'null'
          items:
            type: string
          description: Trimmed and de-duplicated; an empty list is stored as null
        note:
          type:
            - string
            - 'null'
        customer_number:
          type:
            - number
            - 'null'
        last_contact_date:
          type:
            - string
            - 'null'
          format: date-time
    Contact:
      type: object
      properties:
        id:
          type: string
          format: uuid
        agent_id:
          type: string
          format: uuid
          readOnly: true
        customer_name:
          type:
            - string
            - 'null'
          description: Display name, composed from the parts when they are given
        salutation:
          type:
            - string
            - 'null'
          example: Herr
        first_name:
          type:
            - string
            - 'null'
        last_name:
          type:
            - string
            - 'null'
        name_parsed:
          $ref: '#/components/schemas/NameParsed'
        name_source:
          type: string
          enum:
            - ai
            - manual
          readOnly: true
          description: >-
            `manual` = maintained by a person (API or Dashboard); the AI never
            overwrites such a name
        phone_number:
          type:
            - string
            - 'null'
          description: >-
            Primary number in E.164 — the voice agent matches callers against
            this and `mobile_number`
        mobile_number:
          type:
            - string
            - 'null'
        landline_number:
          type:
            - string
            - 'null'
        email:
          type:
            - string
            - 'null'
          format: email
        address:
          type:
            - string
            - 'null'
        company:
          type:
            - string
            - 'null'
        tags:
          type:
            - array
            - 'null'
          items:
            type: string
          description: >-
            Free tags; an agent's `greeting_variants` can pick a greeting per
            tag
        note:
          type:
            - string
            - 'null'
        customer_number:
          type:
            - number
            - 'null'
        last_contact_date:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    NameParsed:
      type: string
      enum:
        - auto
        - llm
        - manual
        - unclear
      readOnly: true
      description: >
        Whether `salutation`/`first_name`/`last_name` are usable for a personal

        greeting. `manual` = parts sent explicitly, `auto` = split unambiguously

        from `customer_name`, `llm` = split by the backfill, `unclear` = not

        split (full name kept in `last_name`) — the voice agent then greets
        neutrally.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - request_id
          properties:
            code:
              type: string
              enum:
                - VALIDATION_ERROR
                - UNAUTHORIZED
                - FORBIDDEN
                - AGENT_NOT_ACCESSIBLE
                - NOT_FOUND
                - CONFLICT
                - RATE_LIMITED
                - INTERNAL_ERROR
            message:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                  message:
                    type: string
            request_id:
              type: string
  responses:
    ValidationError:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: VALIDATION_ERROR
              message: Invalid request body
              details:
                - field: llm_temperature
                  message: Must be between 0 and 2
              request_id: req_abc123
    Unauthorized:
      description: Missing or invalid authentication
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: UNAUTHORIZED
              message: Invalid or missing API key
              request_id: req_abc123
    Forbidden:
      description: >
        Insufficient permissions (`FORBIDDEN`), or the agent is outside the
        key's

        `allowed_agent_ids` (`AGENT_NOT_ACCESSIBLE`)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missingPermission:
              value:
                error:
                  code: FORBIDDEN
                  message: 'API key lacks required permission: agents:write'
                  request_id: req_abc123
            agentNotAccessible:
              value:
                error:
                  code: AGENT_NOT_ACCESSIBLE
                  message: API key does not have access to this agent
                  request_id: req_abc123
    RateLimited:
      description: Too many requests for this API key (60/minute or 1,000/hour by default)
      headers:
        Retry-After:
          description: >-
            Seconds to wait before retrying — 60 for the minute window, 3600 for
            the hour window
          schema:
            type: integer
        X-RateLimit-Limit:
          schema:
            type: integer
        X-RateLimit-Remaining:
          schema:
            type: integer
        X-RateLimit-Reset:
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: RATE_LIMITED
              message: Rate limit exceeded. Try again in 60 seconds.
              request_id: req_abc123
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: |
        API key for external access. Format: `tp_live_<32-hex-chars>`.
        Create keys in the TalkPilot Dashboard under Settings > API.

````