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

# Import Contacts (CSV)

> Bulk-import contacts from a CSV file.

**Required CSV columns:** `phone`

**Optional columns:** `name`, `email`, plus any custom field columns.

Example CSV:
```
phone,name,email,company
+12125551234,Jane Doe,jane@acme.com,Acme Corp
+15551230987,John Smith,john@widget.co,Widget Co
```



## OpenAPI

````yaml /api-reference/openapi.json post /contacts/import
openapi: 3.1.0
info:
  title: Truedy API
  description: >-
    Truedy Public API - Build voice AI agents and make automated phone calls.


    ## Authentication

    All requests require **Authorization: Bearer <your_api_key>**.

    Get your API key from the [Truedy Dashboard](https://app.truedy.ai).


    ## Response Format

    All successful responses follow this format:

    ```json

    {
      "data": { /* resource or list of resources */ },
      "meta": {
        "request_id": "req_xxx",
        "ts": "2026-03-03T20:30:21.310278Z"
      },
      "pagination": { /* optional, for list endpoints */ }
    }

    ```


    ## Error Handling

    Errors return appropriate HTTP status codes with structured error messages.
    Always check the `error` field in the response body for details.
  version: 1.0.0
servers:
  - url: https://api.truedy.ai/api/public/v1
    description: Truedy Public API
security:
  - BearerAuth: []
paths:
  /contacts/import:
    post:
      tags:
        - Contacts
      summary: Import Contacts (CSV)
      description: |-
        Bulk-import contacts from a CSV file.

        **Required CSV columns:** `phone`

        **Optional columns:** `name`, `email`, plus any custom field columns.

        Example CSV:
        ```
        phone,name,email,company
        +12125551234,Jane Doe,jane@acme.com,Acme Corp
        +15551230987,John Smith,john@widget.co,Widget Co
        ```
      operationId: import_contacts
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: >-
                    CSV file. Required column: phone. Optional: name, email,
                    custom fields.
                  example: (binary CSV file content)
                folder_id:
                  description: >-
                    Target folder ID. Contacts go to the default folder if
                    omitted.
                  example: folder_abc123
                  type:
                    - string
                    - 'null'
                overwrite_existing:
                  type: boolean
                  description: Update existing contacts matched by phone number.
                  default: false
            example:
              folder_id: folder_abc123
              overwrite_existing: false
      responses:
        '201':
          description: Import completed
          content:
            application/json:
              example:
                data:
                  imported: 142
                  updated: 8
                  skipped: 3
                  errors: 1
                  folder_id: folder_abc123
                  error_details:
                    - row: 5
                      phone: +1invalid
                      reason: Invalid phone number format
                meta:
                  request_id: req_32e7531c
                  ts: '2026-04-05T10:22:00Z'
        '400':
          description: Bad Request
          content:
            application/json:
              example:
                error:
                  code: bad_request
                  message: Invalid request parameters
        '401':
          description: Unauthorized
          content:
            application/json:
              example:
                error:
                  code: unauthorized
                  message: Invalid or missing API key
                  details:
                    reason: 'Include Authorization: Bearer <your_api_key>'
        '404':
          description: Not Found
          content:
            application/json:
              example:
                error:
                  code: not_found
                  message: Contact not found
        '422':
          description: Validation Error
          content:
            application/json:
              example:
                detail:
                  - loc:
                      - body
                      - name
                    msg: field required
                    type: value_error.missing
        '429':
          description: Rate Limit Exceeded
          content:
            application/json:
              example:
                error:
                  code: rate_limit_exceeded
                  message: Too many requests
                  details:
                    reset_at: '2026-04-01T21:00:00Z'
        '500':
          description: Internal Server Error
          content:
            application/json:
              example:
                error:
                  code: internal_error
                  message: An unexpected error occurred
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication. Include your API key in the Authorization
        header: Bearer <your_api_key>

````