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

# Run selected agent or workspace tests

> Enqueues at most 200 conversations and freezes the selected configuration and tools. Tests already running are skipped. Workspace source IDs are attached to the agent before queueing. A run spends the workspace's credits as conversations do, plan credits first and then purchased credits, and is refused when none are left. Needs a Full access key.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v2/agents/{agentId}/test-runs
openapi: 3.1.0
info:
  title: Centillion Labs API
  description: >-
    The public API of Centillion Labs: agents, their branches and versions,
    knowledge, tools and the secrets they send, chat, conversations, contacts,
    campaigns, batch calls, agent testing, issues and Helpdesk.
  version: 2.0.0
servers:
  - url: https://app.cntillion.com
security:
  - workspaceApiKey: []
  - workspaceApiKeyHeader: []
tags:
  - name: Agents
    description: Create, read, change, clone and delete agents.
  - name: Branches and versions
    description: Branches, drafts, immutable versions, merges, publishing and traffic.
  - name: Workflow and voice
    description: A branch's workflow and its voice settings.
  - name: Tools
    description: 'Workspace tools: HTTP, client, MCP server and code tools.'
  - name: Secrets
    description: >-
      Named credentials, such as an API key, that HTTP tools and MCP servers
      send as a header by naming the secret's id in
      `configuration.secretHeaders`. A value is encrypted when saved and never
      returned. A new value reaches every tool and published agent that uses the
      secret on its next call, with nothing to publish, and a secret can be
      deleted only once no tool and no published agent sends it.
  - name: Auth connections
    description: >-
      How the workspace's tools sign in to an API, kept once and named by id in
      an HTTP tool's or an MCP server's `configuration.authConnectionId` (or
      `configuration.page.authConnectionId` for a web form's link request).
      Secrets are encrypted when saved and never returned. A change reaches
      every tool and published agent that uses the connection on its next call,
      and a connection can be deleted only once nothing signs in with it.
  - name: Knowledge sources
    description: What an agent knows, and training it on that.
  - name: Chat
    description: Talk to an agent from your own systems.
  - name: Conversations
    description: Conversations, their messages, feedback and analysis.
  - name: Leads and contacts
    description: The leads and contacts an agent collected.
  - name: Contacts and enrollments
    description: Upsert contacts and enroll them in always-open campaigns.
  - name: Batch calls
    description: Outbound call batches, their recipients and their runs.
  - name: Campaigns
    description: >-
      Managed outbound calling: campaigns that call each lead within calling
      windows and retry, call back or redirect as their lead policy allows,
      their leads, calls and attention items, and the workspace's campaign
      settings.
  - name: WhatsApp
    description: WhatsApp templates and template messages.
  - name: Agent testing
    description: Workspace tests, agent suites, execution, and results.
  - name: Issues
    description: >-
      Issues an agent raised or a teammate flagged about how it behaves: triage,
      comment, merge and resolve.
  - name: Helpdesk
    description: Helpdesk tickets, their messages, teams and statuses.
  - name: Status
    description: Whether the API is up.
paths:
  /api/v2/agents/{agentId}/test-runs:
    post:
      tags:
        - Agent testing
      summary: Run selected agent or workspace tests
      description: >-
        Enqueues at most 200 conversations and freezes the selected
        configuration and tools. Tests already running are skipped. Workspace
        source IDs are attached to the agent before queueing. A run spends the
        workspace's credits as conversations do, plan credits first and then
        purchased credits, and is refused when none are left. Needs a Full
        access key.
      operationId: runAgentTests
      parameters:
        - name: agentId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 128
        - name: Idempotency-Key
          in: header
          required: true
          description: >-
            Between 1 and 128 characters. A retry with the same key and body
            gets the first answer back and writes nothing; the same key with
            another body is refused with `409`.
          schema:
            type: string
            minLength: 1
            maxLength: 128
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestRunRequest'
      responses:
        '202':
          description: Queued.
          headers:
            Idempotent-Replayed:
              description: >-
                `true` when this is the stored answer to an earlier request with
                the same key.
              schema:
                type: string
                enum:
                  - 'true'
                  - 'false'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunAgentTestsResponse'
        '400':
          $ref: '#/components/responses/Error400'
        '401':
          $ref: '#/components/responses/Error401'
        '403':
          $ref: '#/components/responses/Error403'
        '404':
          $ref: '#/components/responses/Error404'
        '409':
          $ref: '#/components/responses/Error409'
        '413':
          $ref: '#/components/responses/Error413'
        '415':
          $ref: '#/components/responses/Error415'
        '429':
          $ref: '#/components/responses/Error429'
        '500':
          $ref: '#/components/responses/Error500'
        '504':
          $ref: '#/components/responses/Error504'
components:
  schemas:
    TestRunRequest:
      type: object
      properties:
        testIds:
          minItems: 1
          maxItems: 200
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 128
        source:
          default: agent
          type: string
          enum:
            - agent
            - workspace
        repeats:
          default: 1
          type: integer
          minimum: 1
          maximum: 50
        allowMessageCredits:
          default: false
          deprecated: true
          description: >-
            Ignored. Tests spend the workspace's credits, as conversations do,
            with no confirmation.
          type: boolean
        overrides:
          $ref: '#/components/schemas/TestRunOverrides'
      required:
        - testIds
      additionalProperties: false
    RunAgentTestsResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/TestRunAccepted'
      required:
        - data
    TestRunOverrides:
      type: object
      properties:
        channel:
          type: string
          enum:
            - action-preview
            - agent-page
            - android-sdk
            - api
            - center-stage
            - chat-bubble
            - email
            - instagram
            - ios-sdk
            - messenger
            - phone
            - playground
            - qna-preview
            - salesforce
            - search
            - slack
            - sms
            - whatsapp
            - zendesk
            - zendesk-messaging
        environment:
          description: A named environment from the saved test. Defaults to production.
          type: string
          minLength: 1
          maxLength: 100
        target:
          $ref: '#/components/schemas/TestTarget'
        agentOverrides:
          $ref: '#/components/schemas/TestAgentOverrides'
        voiceOverrides:
          $ref: '#/components/schemas/TestVoiceOverridesInput'
        startingWorkflowNodeId:
          type: string
          minLength: 1
          maxLength: 200
        dynamicVariables:
          maxItems: 100
          type: array
          items:
            $ref: '#/components/schemas/TestDynamicVariable'
    TestRunAccepted:
      type: object
      properties:
        requiresConfirmation:
          type: boolean
          const: false
          deprecated: true
          description: 'Always false: a run never waits for a credit confirmation.'
        batchIds:
          type: array
          items:
            type: string
        skipped:
          type: integer
          minimum: 0
          description: 'Selected tests left out: already running.'
        alreadyRunning:
          description: >-
            The tests `skipped` counts, with when their running conversation
            started and how long its worker holds it. A test runs one batch at a
            time.
          type: array
          items:
            type: object
            properties:
              testId:
                type: string
              name:
                type: string
              startedAt:
                anyOf:
                  - type: string
                    format: date-time
                  - type: 'null'
              leaseUntil:
                anyOf:
                  - type: string
                    format: date-time
                  - type: 'null'
            required:
              - testId
              - name
              - startedAt
              - leaseUntil
        suiteId:
          type: string
      required:
        - requiresConfirmation
        - batchIds
        - skipped
        - suiteId
    ApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: A stable code, such as `NOT_FOUND`.
            message:
              type: string
              description: What went wrong, for a person.
            details:
              description: More about the failure, on some endpoints.
          required:
            - code
            - message
      required:
        - error
    TestTarget:
      type: object
      properties:
        type:
          type: string
          enum:
            - draft
            - published
            - branch
            - version
        id:
          description: >-
            Required for branch and version targets. Branch targets use their
            current published version.
          type: string
          minLength: 1
          maxLength: 200
      required:
        - type
    TestAgentOverrides:
      type: object
      properties:
        instructions:
          type: string
          minLength: 20
          maxLength: 100000
        guardrails:
          type: string
          maxLength: 20000
        greeting:
          type: string
          maxLength: 3000
        model:
          type: string
          minLength: 1
          maxLength: 100
        temperature:
          type: number
          minimum: 0
          maximum: 1
        defaultLanguage:
          type:
            - string
            - 'null'
    TestVoiceOverridesInput:
      type: object
      properties:
        pipelineMode:
          type: string
          enum:
            - duplex
            - staged
        realtimeModel:
          type: string
          enum:
            - openai/gpt-live-1
            - openai/gpt-live-1.1
            - openai/gpt-realtime-2.1
            - openai/gpt-realtime-2.1-mini
            - google/gemini-3.8-live
            - xai/grok-voice-3.0
            - elevenlabs/eleven_realtime_v1_mini
            - elevenlabs/eleven_realtime_v1_max
            - phonic/phonic-1
            - phonic/phonic-1-high
        duplexVoice:
          type: string
          minLength: 1
          maxLength: 100
        model:
          type: string
          minLength: 1
          maxLength: 100
        temperature:
          type: number
          minimum: 0
          maximum: 1
        voiceProvider:
          type: string
          enum:
            - centillion
            - elevenlabs
            - google
            - minimax
            - inworld
            - fishaudio
        voiceId:
          type: string
          minLength: 1
          maxLength: 200
        voiceName:
          type: string
          minLength: 1
          maxLength: 100
        voiceLanguage:
          type: string
          minLength: 2
          maxLength: 40
        speed:
          anyOf:
            - type: number
              minimum: 0.5
              maximum: 2
            - type: 'null'
        stability:
          anyOf:
            - type: number
              minimum: 0
              maximum: 1
            - type: 'null'
        similarity:
          anyOf:
            - type: number
              minimum: 0
              maximum: 1
            - type: 'null'
        turnEagerness:
          type: string
          enum:
            - patient
            - normal
            - eager
        reasoningEffort:
          type: string
          enum:
            - none
            - minimal
            - low
            - medium
            - high
            - xhigh
            - max
        serviceTier:
          type: string
          enum:
            - standard
            - fast
        turnDetection:
          description: >-
            Custom (staged) calls only: how the call decides the caller has
            finished. `silence` waits the Eagerness delay after the caller stops
            speaking; `model` lets an end-of-turn model decide, which waits
            longer when the caller sounds unfinished. Left out, the agent's own
            setting, or the platform's when the agent has none.
          type: string
          enum:
            - silence
            - model
      additionalProperties: false
      description: >-
        Voice tests only: voice settings this run uses instead of the agent's,
        in the Voice settings form's values. Left-out fields keep the agent's.
    TestDynamicVariable:
      type: object
      properties:
        name:
          type: string
          maxLength: 100
          pattern: ^[A-Za-z_][A-Za-z0-9_]*$
        value:
          $ref: '#/components/schemas/JsonValue'
          description: Any JSON value, at most 10,000 characters when serialized.
      required:
        - name
        - value
    JsonValue:
      anyOf:
        - type: string
        - type: number
        - type: boolean
        - type: 'null'
        - type: array
          items:
            $ref: '#/components/schemas/JsonValue'
        - type: object
          propertyNames:
            type: string
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
  responses:
    Error400:
      description: The request is invalid. `error.message` names the first problem.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error401:
      description: No valid workspace API key was sent.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error403:
      description: The key or the workspace's plan does not allow this request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error404:
      description: The endpoint, or a record it names, was not found in this workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error409:
      description: The record changed since it was read, or its state does not allow this.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error413:
      description: The request body is too large.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error415:
      description: The request body is not of a media type this endpoint accepts.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error429:
      description: Too many requests. Wait for `Retry-After` seconds.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error500:
      description: The request could not be completed. Try again.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error504:
      description: The request took too long. Try again.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    workspaceApiKey:
      type: http
      scheme: bearer
      bearerFormat: cl_api_...
      description: >-
        A workspace API key from Workspace settings > API keys, sent as
        `Authorization: Bearer cl_api_...`. A Read only key can call the GET
        endpoints; every other method needs a Full access key.
    workspaceApiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        The same workspace API key, for a gateway that keeps `Authorization` for
        itself.

````

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