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

# Create a contact for a campaign

> Adds a contact to the specified campaign. Optionally fixes US phone numbers by adding a leading 1 if not present. Returns 400 with detailed error message if phone number validation fails.



## OpenAPI

````yaml https://api.callers.ai/openapi-json post /campaigns/{campaignId}/contacts
openapi: 3.0.0
info:
  title: Callers API
  description: API documentation for Callers, providing endpoints for seamless integration.
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.callers.ai
security: []
tags: []
paths:
  /campaigns/{campaignId}/contacts:
    post:
      tags:
        - Contacts
      summary: Create a contact for a campaign
      description: >-
        Adds a contact to the specified campaign. Optionally fixes US phone
        numbers by adding a leading 1 if not present. Returns 400 with detailed
        error message if phone number validation fails.
      operationId: CampaignPublicController_createContact
      parameters:
        - name: campaignId
          required: true
          in: path
          schema:
            type: string
        - name: fixUSPhoneNumber
          required: false
          in: query
          description: Will add 1 to the phone number if it doesn't starts with 1
          schema:
            type: boolean
        - name: ignorePhoneNumberValidation
          required: false
          in: query
          description: Skip phone number validation for contacts
          schema:
            type: boolean
        - name: x-sub-organization-id
          in: header
          schema:
            type: string
          description: >-
            Optional sub organization ID. Must belong to your main organization
            API key.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignContactCreateDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createSingleContactResponseDto'
        '400':
          description: >-
            Bad Request - validation failed. The error message includes detailed
            information about which fields failed validation (e.g.,
            "phoneNumber: Phone number is not valid: 225747466045").
        '403':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
        '404':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
      security:
        - Authorization: []
components:
  schemas:
    CampaignContactCreateDto:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        phoneNumber:
          type: string
          minLength: 7
          maxLength: 20
          pattern: ^\+?[\d()-]+$
        phoneNumbers:
          type: array
          items:
            type: string
            minLength: 7
            maxLength: 20
            pattern: ^\+?[\d()-]+$
        timezone:
          type: string
        data:
          type: object
          additionalProperties:
            type: string
        archived:
          type: boolean
          default: false
      required:
        - name
        - data
    createSingleContactResponseDto:
      type: object
      properties:
        contactId:
          type: string
          description: ID of the created or updated contact.
        created:
          type: boolean
          description: True if a new contact was created.
        modified:
          type: boolean
          description: True if an existing contact was modified.
      required:
        - contactId
        - created
        - modified
  securitySchemes:
    Authorization:
      type: apiKey
      in: header
      name: Authorization

````