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

# Add contacts to audience

> Adds one or more contacts to an audience.



## OpenAPI

````yaml /api-reference/openapi.json post /audience/add-contacts
openapi: 3.1.0
info:
  title: SuperU API
  description: >-
    Comprehensive API reference for SuperU voice agents, calls, tools, contacts,
    audiences, and knowledge bases.
  version: 1.0.0
servers:
  - url: https://voip-middlware.superu.ai
    description: Production
security:
  - superUApiKey: []
tags:
  - name: Calls
    description: Create and analyze calls.
  - name: Agents
    description: Create, list, import, update, and delete agents.
  - name: Agent Versions
    description: Manage versions for existing agents.
  - name: Phone Numbers
    description: Fetch phone numbers available in your account.
  - name: Call Logs
    description: Retrieve call history with filters.
  - name: Tools
    description: Create and manage callable tools.
  - name: Folders
    description: Organize agents into folders.
  - name: Contacts
    description: Create and list contacts.
  - name: Audiences
    description: Create and manage audiences and contacts.
  - name: Knowledge Base
    description: Upload and manage knowledge bases.
  - name: Campaigns
    description: Create and manage outbound campaigns with automated workflows.
paths:
  /audience/add-contacts:
    post:
      tags:
        - Audiences
      summary: Add contacts to audience
      description: Adds one or more contacts to an audience.
      operationId: addAudienceContacts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AudienceAddContactsRequest'
            example:
              audience_id: 597b3dde-9169-4017-800d-f97a5fabebe3
              contacts:
                - first_name: Emma
                  last_name: Watson
                  email: emma@example.com
                  country_code: '+1'
                  phone_number: '5551234523'
                  variable_values:
                    key: value
        description: Request body for Add contacts to audience.
      responses:
        '200':
          description: Contacts added
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericResponse'
              example:
                message: Successfully added 1 contact(s) to audience
                audience_id: 597b3dde-9169-4017-800d-f97a5fabebe3
                audience_name: Demo Audience - Q1
                contacts_added: 1
                total_contacts_provided: 1
                contacts:
                  - id: 69f9aa813ff1953354e5e428
                    first_name: Emma
                    last_name: Watson
                    email: emma@example.com
                    country_code: '+1'
                    phone_number: '5551234523'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Audience not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '501':
          $ref: '#/components/responses/NotImplemented'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl --request POST \\
              --url https://voip-middlware.superu.ai/audience/add-contacts \\
              --header 'superU-Api-Key: YOUR_SUPERU_API_KEY' \\
              --data '{
              "audience_id": "597b3dde-9169-4017-800d-f97a5fabebe3",
              "contacts": [
                {
                  "first_name": "Emma",
                  "last_name": "Watson",
                  "email": "emma@example.com",
                  "country_code": "+1",
                  "phone_number": "5551234523",
                  "variable_values": {
                    "key": "value"
                  }
                }
              ]
            }'
        - lang: python
          label: Python
          source: |-
            from superu import SuperU

            client = SuperU("YOUR_SUPERU_API_KEY")

            payload = {
                "audience_id": "597b3dde-9169-4017-800d-f97a5fabebe3",
                "contacts": [
                    {
                        "first_name": "Emma",
                        "last_name": "Watson",
                        "email": "emma@example.com",
                        "country_code": "+1",
                        "phone_number": "5551234523",
                        "variable_values": {
                            "key": "value"
                        }
                    }
                ]
            }

            response = client.audience.add_contacts(**payload)
            print(response)
components:
  schemas:
    AudienceAddContactsRequest:
      allOf:
        - type: object
          required:
            - audience_id
            - contacts
          properties:
            audience_id:
              type: string
              description: Audience ID
              example: 597b3dde-9169-4017-800d-f97a5fabebe3
            contacts:
              type: array
              minItems: 1
              items:
                $ref: '#/components/schemas/AudienceContact'
              description: Contacts value.
      description: Audience Add Contacts Request schema.
    GenericResponse:
      type: object
      properties:
        status:
          type: string
          description: Indicates if the request was successful.
          example: success
        message:
          type: string
          description: A descriptive message about the result of the request.
          example: Request completed successfully
        data:
          type: object
          additionalProperties: true
          description: The payload of the response, if any.
      additionalProperties: true
      description: A generic response schema for successful API calls.
    ErrorResponse:
      type: object
      required:
        - message
      properties:
        status:
          type: string
          example: error
          description: Status value.
        message:
          type: string
          example: Invalid request payload
          description: Message value.
        error:
          type: string
          example: Bad Request
          description: Error value.
        code:
          type: string
          example: BAD_REQUEST
          description: Code value.
      additionalProperties: true
      description: Error Response schema.
    AudienceContact:
      type: object
      required:
        - first_name
        - country_code
        - phone_number
      properties:
        first_name:
          type: string
          example: Ava
          description: First name value.
        last_name:
          type: string
          example: Patel
          description: Last name value.
        email:
          type: string
          format: email
          example: ava.patel@example.com
          description: Email value.
        country_code:
          type: string
          example: '+1'
          description: Country code value.
        phone_number:
          type: string
          example: '5551234567'
          description: Phone number value.
        variable_values:
          $ref: '#/components/schemas/JsonObject'
          description: Variable values value.
      description: Audience Contact schema.
    JsonObject:
      type: object
      description: Flexible JSON object
      additionalProperties: true
      example:
        key: value
  responses:
    BadRequest:
      description: Bad Request - invalid parameters or payload.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            code: BAD_REQUEST
            message: Request validation failed.
    Unauthorized:
      description: Unauthorized - missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            code: UNAUTHORIZED
            message: Invalid or missing superU-Api-Key.
    InternalServerError:
      description: Internal Server Error - unexpected backend error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            code: INTERNAL_SERVER_ERROR
            message: An unexpected server error occurred.
    NotImplemented:
      description: >-
        Not Implemented - this action is not available in the current
        deployment.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            code: NOT_IMPLEMENTED
            message: This endpoint is not implemented for your workspace.
  securitySchemes:
    superUApiKey:
      type: apiKey
      in: header
      name: superU-Api-Key
      description: Your SuperU API key.

````