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

# upload an audience

> save a CSV of people to call (`.csv` / `.tsv` / `.txt`, up to 10 MB and 10,000 rows, comma / tab / semicolon delimited, first row = header). `phoneColumn` names the column with the numbers; numbers without a country code get `defaultCountryCode` (default `+91`), and rows whose number can't be read are skipped and counted. `contextColumns` — a JSON **string**, since a form can't nest — names the columns the agent is given for each person, each with a description; left out, every column. a variable in the agent's prompt can also take a column's value: set its `campaignColumn` (see variables).



## OpenAPI

````yaml /openapi.json post /v1/campaign-audiences
openapi: 3.1.0
info:
  title: silk api
  version: 1.0.0
  description: >-
    rumik ai's speech api. synthesize speech with the expressive `muga` model or
    the faster `mulberry` model over http or a streaming websocket session, run
    conversational voice agents over webrtc, a realtime pcm socket or the phone,
    and manage everything the agents playground does — agents, voices,
    variables, tools, phone numbers, sip trunks and outbound calls — with the
    same api key.
  contact:
    name: rumik ai
    url: https://rumik.ai
servers:
  - url: https://silk-api.rumik.ai
    description: production
security:
  - bearerAuth: []
tags:
  - name: speech
    description: text-to-speech over HTTP and WebSocket.
  - name: voice agents
    description: start calls with a deployed agent from your own app.
  - name: agents
    description: build, configure, deploy and inspect your agents.
  - name: calls
    description: place outbound phone calls and read call history.
  - name: voices
    description: the voices, languages and styles an agent may use.
  - name: variables
    description: account-wide `{name}` prompt variables and their defaults.
  - name: tools
    description: HTTP tools agents call before or during a call.
  - name: phone numbers
    description: 'numbers rented through rumik: search, rent, connect, release.'
  - name: sip trunks
    description: bring your own numbers over SIP.
  - name: campaign audiences
    description: >-
      the contact lists (CSV uploads) a campaign calls, and the columns its
      agent gets.
  - name: campaigns
    description: >-
      outbound campaigns: an agent calling an audience from your own number,
      with retries and a start time — and every call's transcript and recording.
paths:
  /v1/campaign-audiences:
    post:
      tags:
        - campaign audiences
      summary: upload an audience
      description: >-
        save a CSV of people to call (`.csv` / `.tsv` / `.txt`, up to 10 MB and
        10,000 rows, comma / tab / semicolon delimited, first row = header).
        `phoneColumn` names the column with the numbers; numbers without a
        country code get `defaultCountryCode` (default `+91`), and rows whose
        number can't be read are skipped and counted. `contextColumns` — a JSON
        **string**, since a form can't nest — names the columns the agent is
        given for each person, each with a description; left out, every column.
        a variable in the agent's prompt can also take a column's value: set its
        `campaignColumn` (see variables).
      operationId: createCampaignAudience
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AudienceUpload'
            examples:
              default:
                value:
                  file: <leads.csv>
                  name: September leads
                  phoneColumn: mobile
                  contextColumns: '[{"column": "city", "description": "where they live"}]'
      responses:
        '201':
          description: created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Audience'
              examples:
                default:
                  value:
                    id: 01a0b054-6f82-7193-ce0f-1a2b3c4d5e6f
                    name: September leads
                    columns:
                      - name
                      - city
                      - mobile
                    phoneColumn: mobile
                    contextColumns:
                      - column: city
                        description: where they live
                      - column: mobile
                        description: the phone number this call is going to
                    contactCount: 2
                    skippedCount: 1
                    sourceFilename: leads.csv
                    createdAt: '2026-10-01T09:00:00Z'
                    updatedAt: '2026-10-01T09:00:00Z'
        '401':
          description: >-
            `unauthorized` — key missing, malformed, unknown, revoked or
            expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                unauthorized:
                  value:
                    error: Invalid API key
                    code: unauthorized
        '403':
          description: '`forbidden_scope` — the key was created without the `agent` scope.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                forbidden_scope:
                  value:
                    error: This API key lacks the 'agent' scope
                    code: forbidden_scope
        '422':
          description: >-
            `invalid_request` — a field is missing or malformed. `details` lists
            every failing field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid_request:
                  value:
                    error: >-
                      body.toNumber: must be an E.164 phone number, e.g.
                      +14155551234
                    code: invalid_request
                    details:
                      - loc: body.toNumber
                        message: must be an E.164 phone number, e.g. +14155551234
        '429':
          description: >-
            `rate_limited` — the key's per-minute budget is spent. `Retry-After`
            says how long to wait; the body carries `limit` and `current`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                rate_limited:
                  value:
                    error: Rate limit exceeded
                    code: rate_limited
                    limit: 100
                    current: 101
          headers:
            Retry-After:
              description: seconds to wait before retrying (per-key rate limit only).
              schema:
                type: integer
components:
  schemas:
    AudienceUpload:
      properties:
        file:
          anyOf:
            - type: string
              contentMediaType: application/octet-stream
            - type: 'null'
          description: >-
            the CSV: `.csv` / `.tsv` / `.txt`, up to 10 MB and 10,000 rows,
            first row = header.
        name:
          anyOf:
            - type: string
            - type: 'null'
          description: the audience's name, up to 120 characters.
        phoneColumn:
          anyOf:
            - type: string
            - type: 'null'
          description: the header of the column with the phone numbers (case-insensitive).
        defaultCountryCode:
          anyOf:
            - type: string
            - type: 'null'
          description: added to numbers without a country code. default `+91`.
        contextColumns:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            a JSON string: `[{"column": "city", "description": "where they
            live"}]` — the columns the agent is given for each person. left out,
            every column.
      type: object
      title: AudienceUpload
      description: the multipart form of `POST /v1/campaign-audiences`.
    Audience:
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        columns:
          items:
            type: string
          type: array
        phoneColumn:
          type: string
        contextColumns:
          anyOf:
            - items:
                $ref: '#/components/schemas/ContextColumn'
              type: array
            - type: 'null'
        contactCount:
          type: integer
        skippedCount:
          type: integer
        sourceFilename:
          anyOf:
            - type: string
            - type: 'null'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      type: object
      required:
        - id
        - name
        - columns
        - phoneColumn
        - contactCount
        - skippedCount
        - sourceFilename
        - createdAt
        - updatedAt
      title: Audience
      description: a contact list (CSV) a campaign calls, with the columns its agent gets.
    Error:
      type: object
      properties:
        error:
          type: string
          description: human-readable error message.
        code:
          type: string
          description: machine-readable error code.
    ContextColumn:
      properties:
        column:
          type: string
          maxLength: 64
          minLength: 1
          description: a header of the audience's CSV (case-insensitive).
        description:
          type: string
          maxLength: 200
          default: ''
          description: >-
            what the column means, written for the agent (up to 200 characters).
            shown to it as `- city (where they live): Pune`.
      type: object
      required:
        - column
      title: ContextColumn
      description: an audience column given to the agent, and what it means.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        your rumik api key, e.g. `rk_live_...`. create one in the rumik
        dashboard.

````

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