> ## 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.

# preview a csv

> what a CSV holds — its columns, a few rows and the column that most likely holds the phone numbers (a header like `phone` / `mobile` with valid numbers, else the column with the most) — without saving anything. same file rules as an upload.



## OpenAPI

````yaml /openapi.json post /v1/campaign-audiences/preview
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/preview:
    post:
      tags:
        - campaign audiences
      summary: preview a csv
      description: >-
        what a CSV holds — its columns, a few rows and the column that most
        likely holds the phone numbers (a header like `phone` / `mobile` with
        valid numbers, else the column with the most) — without saving anything.
        same file rules as an upload.
      operationId: previewCampaignAudience
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AudiencePreviewUpload'
            examples:
              default:
                value:
                  file: <leads.csv>
      responses:
        '200':
          description: ok.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AudiencePreview'
              examples:
                default:
                  value:
                    filename: leads.csv
                    columns:
                      - name
                      - city
                      - mobile
                    rowCount: 3
                    sampleRows:
                      - name: Asha
                        city: Pune
                        mobile: '9876543210'
                    suggestedPhoneColumn: mobile
                    validCount: 2
        '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:
    AudiencePreviewUpload:
      properties:
        file:
          anyOf:
            - type: string
              contentMediaType: application/octet-stream
            - type: 'null'
          description: the CSV to read.
        defaultCountryCode:
          anyOf:
            - type: string
            - type: 'null'
          description: used to tell which numbers are valid. default `+91`.
      type: object
      title: AudiencePreviewUpload
    AudiencePreview:
      properties:
        filename:
          type: string
        columns:
          items:
            type: string
          type: array
        rowCount:
          type: integer
        sampleRows:
          items:
            type: object
            additionalProperties:
              type: string
          type: array
        suggestedPhoneColumn:
          anyOf:
            - type: string
            - type: 'null'
        validCount:
          anyOf:
            - type: integer
            - type: 'null'
      type: object
      required:
        - filename
        - columns
        - rowCount
        - sampleRows
        - suggestedPhoneColumn
        - validCount
      title: AudiencePreview
    Error:
      type: object
      properties:
        error:
          type: string
          description: human-readable error message.
        code:
          type: string
          description: machine-readable error code.
  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.