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

# Check a CSV before creating anything

> What the file would do, without doing it. Runs the same parse and the
same admission `POST /batches/{id}/rows.csv` runs, against the prompt of
the agent you name — so a row this reports as good cannot be refused on
confirm. **Writes nothing:** no batch, no rows, no calls.

There is no batch id because there is no batch yet. A dry-run flag on
the append route would mean creating one first, and the point of
checking a file is that walking away from it costs nothing.

Duplicates are reported, not rejected. The same number twice is a
mistake often enough to show and deliberate often enough that refusing
it here would make the CSV path stricter than the JSON one.




## OpenAPI

````yaml /openapi/api-public-v1.yaml post /batches/rows.csv/preview
openapi: 3.0.3
info:
  title: Vodex API (v1)
  description: >
    The **public Vodex `/v1` REST API** — everything a customer's own systems

    integrate with: assistants, telephony (numbers, trunks, carrier

    integrations), calls and recordings, batch dialing, the SMS channel, and

    outbound webhooks.


    This is deliberately a **subset**. Account and console-only routes

    (`/v1/auth/*`, `/v1/api-keys`, `/v1/usage`), platform provisioning

    (`/v1/platform/*`), Vodex support operations, and endpoints other systems

    call inward (carrier delivery receipts, the agent worker, cron) are not

    part of the published surface and are not documented here.


    The **data plane** (LiveKit SFU + SIP + the agent worker) is not an HTTP

    API and is not described here: a call reaches the worker over LiveKit, with

    its config carried in participant metadata or read from the config snapshot

    this API publishes.


    ## Authentication


    | Credential | Sent as | Scope |

    |---|---|---|

    | **Tenant API key** | `Authorization: Bearer vdx_live_…` | One customer,
    full access — the credential for everything in this document |


    Mint an API key in the console (**Settings → API keys**). The plaintext is

    shown **once**, by the call that creates it, and no endpoint reads one back

    — a lost key is replaced, not recovered.


    Every route here also answers a signed-in console session, because the

    console is built on this same API. That is **not** an integration

    credential and is deliberately not described as one: it is the console's

    own cookie, it carries a role an API key never has, and it is free to

    change. Integrate with `vdx_live_`.


    ## Customers and tenants


    One thing, two words, and they are not interchangeable:


    - **Customer** is the product word — what a human calls the account, and
      what the console shows you.
    - **Tenant** is the same thing's identity on the wire and in storage:
      `tenantId` on every response.

    **A *workspace* is a third thing, and not a synonym for either.** Tenancy

    is mapped at the customer level deliberately: integrations (carrier, SMS,

    provider credentials) live above the workspaces that use them, so mapping

    workspaces to tenants would fragment one customer's telephony across

    tenants that then have to share credentials. A workspace is therefore a

    **label inside the tenant** (`externalWorkspaceRef`) — for filtering and

    attribution, never isolation. Anything that must not be shared between one

    customer's workspaces needs its own tenant.


    ## Tenancy


    There is **no tenant parameter**. Every tenant-scoped route derives its

    tenant from the credential and binds it for the whole request, so a caller

    cannot ask for another tenant's data by changing a query string. An id that

    belongs to somebody else answers `404`, never `403` — "no such call" is the

    only thing worth confirming.


    ## Response shapes


    Resources are returned **flat**, at the top level (`{ "id": "…", … }`) —

    there is no envelope object. Collections vary by age of the endpoint:


    - Newer lists are `{ "<plural>": [ … ], "total": n, "limit": n, "offset": n
    }`
      (`calls`, `batches`, `rows`, `attempts`, `messages`).
    - Older lists return a **bare JSON array** (`/v1/phone-numbers`,
      `/v1/sip-trunks`, `/v1/integrations`, `/v1/carriers`,
      `/v1/console/assistants`, `/v1/sms/configurations`).

    Deletes and side-effecting no-content operations return `{ "ok": true }`.


    ## Errors


    ```json

    { "error": "human-readable message" }

    ```


    A flat string, not a coded object — HTTP status is the machine signal.

    The one exception is quota exhaustion (`402`), which adds a stable

    `code: "quota_exhausted"` plus the counters the console renders.


    ## Pagination


    `?limit=` and `?offset=`, with `total` in the body. Defaults and ceilings

    differ per endpoint (calls 25/100, batch rows 50/500, attempts 100/500) and

    are stated on each operation.


    ## Conventions


    - **Phone numbers** are E.164 strings (`+14155551234`); `+91…` numbers are
      served from Mumbai, `+1…` from us-central1.
    - **Money** is a JSON number of **USD** (`costUsd`), not a decimal string.

    - **Timestamps** are ISO‑8601 UTC strings, except the calls list, which
      reports `mtime` / `startedAt` as epoch **milliseconds** and durations as
      **milliseconds**.
    - **Ids** are unprefixed: batches, rows, attempts and SMS rows are UUIDs;
      a call id is its LiveKit room name (`call-…`, or `console-…` for web
      calls); a phone number's id is `num-<digits>`; a trunk's is `trunk-…`.
    - **Secrets** (`vdx_live_…`, `whsec_…`) are returned exactly once, by the
      call that mints them. No endpoint reads one back — carrier and provider
      credentials are stored in Secret Manager and echoed only as a
      non-reversible fingerprint.
    - **Idempotency**: `POST /v1/sms` and `POST /v1/batches` **require** an
      `Idempotency-Key` header. Only successful (2xx) responses are replayed;
      a failed attempt releases the key so a corrected retry can reuse it.
  version: 1.0.0
  contact:
    name: Vodex Platform
    url: https://vodex.ai
  license:
    name: Proprietary
    url: https://vodex.ai/terms
servers:
  - url: https://apiv2.vodex.ai/v1
    description: Production
security:
  - ApiKeyBearer: []
tags:
  - name: Assistants
    description: Assistant configurations (the agent's engine, prompt, slots, tools).
  - name: Console
    description: Reference data (model catalog, voices) and the web-call token.
  - name: Usage
    description: Minute usage against the plan.
  - name: Calls
    description: Place calls, read the call log, fetch traces and recordings.
  - name: Phone Numbers
    description: Number inventory and assistant mapping.
  - name: SIP Trunks
    description: Customer-owned (BYO) SIP trunks.
  - name: Carriers
    description: Carrier registry — what can be connected, and how.
  - name: Integrations
    description: Connected carrier accounts and their numbers.
  - name: Batches
    description: Batch dialing — lists in, calls out.
  - name: Number Rotation
    description: Per-number spacing, daily caps, and cooldown.
  - name: Callbacks
    description: >-
      "Call me Tuesday afternoon" — appointments booked mid-call, and dialed
      later.
  - name: SMS
    description: SMS configurations, credentials, preview, send, and message log.
  - name: Webhooks
    description: Outbound webhook configuration and delivery records.
  - name: Tenants
    description: Recording retention.
  - name: Contacts
    description: >-
      The people a tenant calls — records, channels, custom attributes, files,
      and CSV import.
  - name: Audiences
    description: >-
      Saved filters over contacts. Stored as a filter tree, never a frozen id
      list.
  - name: Campaigns
    description: An audience plus an assistant, executed as a batch.
  - name: Do Not Contact
    description: The address suppression list, and the person-level decision beside it.
paths:
  /batches/rows.csv/preview:
    post:
      tags:
        - Batches
      summary: Check a CSV before creating anything
      description: |
        What the file would do, without doing it. Runs the same parse and the
        same admission `POST /batches/{id}/rows.csv` runs, against the prompt of
        the agent you name — so a row this reports as good cannot be refused on
        confirm. **Writes nothing:** no batch, no rows, no calls.

        There is no batch id because there is no batch yet. A dry-run flag on
        the append route would mean creating one first, and the point of
        checking a file is that walking away from it costs nothing.

        Duplicates are reported, not rejected. The same number twice is a
        mistake often enough to show and deliberate often enough that refusing
        it here would make the CSV path stricter than the JSON one.
      operationId: previewBatchRowsCsv
      parameters:
        - name: assistantId
          in: query
          required: false
          description: Required unless given in the JSON body.
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                csv:
                  type: string
                assistantId:
                  type: string
                  format: uuid
                mapping:
                  type: object
                  additionalProperties:
                    type: string
                  description: |
                    Corrections to auto-detection, keyed by the header as
                    written: `to`, `rowRef`, `assistantId`, `from`, `var:<name>`
                    for a prompt variable, or `""` to ignore the column. Columns
                    left out are detected as usual. Where two columns claim one
                    single-valued field the leftmost keeps it, and the resolved
                    mapping comes back in the response.
              required:
                - csv
            example:
              csv: |
                Mobile No,name,AMT DUE
                +14155551234,Dana,120.50
              assistantId: 8f1c3b6e-9d2a-4c77-a2f1-6b0f2f4e1a90
              mapping:
                Mobile No: to
                AMT DUE: var:balance
          text/csv:
            schema:
              type: string
            example: |
              to,rowRef,name,balance
              +14155551234,acct_991,Dana,120.50
      responses:
        '200':
          description: |
            The verdict — including when every row is bad. Previewing a broken
            file is a successful preview, and the counts are the answer.
          content:
            application/json:
              schema:
                type: object
                properties:
                  headers:
                    type: array
                    items:
                      type: string
                    description: The file's columns, in its own order.
                  mapping:
                    type: object
                    additionalProperties:
                      type: string
                    description: What each column was read as, after corrections.
                  total:
                    type: integer
                    description: Rows under the header, blank lines excluded.
                  valid:
                    type: integer
                    description: Rows that would be dialled.
                  errorRows:
                    type: integer
                    description: Parse failures plus rejections.
                  duplicates:
                    type: integer
                    description: >-
                      Rows whose `to` appeared on an earlier line. Dialled
                      anyway.
                  errors:
                    type: array
                    description: Every problem row, capped at 5,000 entries.
                    items:
                      type: object
                      properties:
                        line:
                          type: integer
                          description: The line the customer's editor shows.
                        to:
                          type: string
                        reason:
                          type: string
                  errorsTruncated:
                    type: boolean
                    description: More problems than `errors` lists. The counts stay exact.
                  sample:
                    type: array
                    description: The first 50 lines in file order, each with its verdict.
                    items:
                      type: object
                      properties:
                        line:
                          type: integer
                        to:
                          type: string
                        rowRef:
                          type: string
                        variables:
                          type: object
                          additionalProperties:
                            type: string
                        reason:
                          type: string
                          description: Why this row would be refused.
                        duplicate:
                          type: boolean
        '400':
          description: |
            Empty body, no `assistantId`, or over the 100,000-row cap. A file
            with no usable `to` column is NOT an error — it comes back as a 200
            carrying the columns, so one can be pointed at.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: No such agent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          example: not found
  responses:
    Unauthorized:
      description: No usable credential.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyBearer:
      type: http
      scheme: bearer
      description: 'Tenant API key (`vdx_live_…`) as `Authorization: Bearer`.'

````