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

# Create an agent-local test

> An agent holds up to 200 tests (`400 TEST_LIMIT`). On an agent with a Main branch the test is published to Main, and a protected Main is refused with `403 BRANCH_PROTECTED`. Needs a Full access key.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v2/agents/{agentId}/tests
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}/tests:
    post:
      tags:
        - Agent testing
      summary: Create an agent-local test
      description: >-
        An agent holds up to 200 tests (`400 TEST_LIMIT`). On an agent with a
        Main branch the test is published to Main, and a protected Main is
        refused with `403 BRANCH_PROTECTED`. Needs a Full access key.
      operationId: createAgentTest
      parameters:
        - name: agentId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 128
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentTestWrite'
      responses:
        '201':
          description: Created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAgentTestResponse'
        '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:
    AgentTestWrite:
      type: object
      properties:
        configuration:
          $ref: '#/components/schemas/AgentTestConfigurationInput'
        revision:
          description: Required on updates; use the revision from the latest read.
          type: integer
          minimum: 0
      required:
        - configuration
      additionalProperties: false
    CreateAgentTestResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              type: string
          required:
            - id
      required:
        - data
    AgentTestConfigurationInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 150
        simulatedUser:
          default: ''
          description: Required and nonempty for simulation tests.
          type: string
          maxLength: 10000
        successCriterion:
          default: ''
          description: Required and nonempty except for tool invocation tests.
          type: string
          maxLength: 10000
        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'
        environments:
          maxItems: 20
          type: array
          items:
            $ref: '#/components/schemas/TestEnvironmentInput'
        expectedWorkflowTransitions:
          maxItems: 100
          type: array
          items:
            $ref: '#/components/schemas/TestWorkflowTransition'
        forbiddenWorkflowTransitions:
          description: >-
            Moves that fail the test if the agent makes them. Leave fromNodeId
            out to forbid reaching the node from anywhere.
          maxItems: 100
          type: array
          items:
            $ref: '#/components/schemas/TestWorkflowTransition'
        guardrailCheck:
          description: Whether spam detection should flag the customer's messages.
          type: string
          enum:
            - triggered
            - not_triggered
        ignoreToolCalls:
          description: >-
            For a tool invocation test that checks a workflow move or a
            guardrail: don't fail it for the tools the agent called.
          type: boolean
        sourceConversation:
          type: object
          properties:
            conversationId:
              type: string
              minLength: 1
              maxLength: 200
            messageId:
              type: string
              minLength: 1
              maxLength: 200
            source:
              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
            originalReply:
              description: >-
                What the agent did at this point in the conversation, for
                comparison.
              maxItems: 40
              type: array
              items:
                oneOf:
                  - type: object
                    properties:
                      kind:
                        type: string
                        const: message
                      content:
                        type: string
                        minLength: 1
                        maxLength: 12000
                    required:
                      - kind
                      - content
                  - type: object
                    properties:
                      kind:
                        type: string
                        const: transition
                      to:
                        type: string
                        minLength: 1
                        maxLength: 200
                    required:
                      - kind
                      - to
                  - type: object
                    properties:
                      kind:
                        type: string
                        const: tool
                      name:
                        type: string
                        minLength: 1
                        maxLength: 200
                      actionId:
                        type: string
                        minLength: 1
                        maxLength: 200
                      input:
                        description: The tool's parameters as a JSON object.
                        type: string
                        maxLength: 50000
                      output:
                        type: string
                        maxLength: 12000
                        description: The tool's result. Empty when it wasn't recorded.
                      isError:
                        default: false
                        type: boolean
                    required:
                      - kind
                      - name
                      - input
                      - output
                    description: A tool the agent ran, with the fields of a history tool.
          required:
            - conversationId
        maxTurns:
          type: integer
          minimum: 1
          maximum: 50
        expectedActions:
          maxItems: 100
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 150
        actionResponses:
          maxItems: 100
          type: array
          items:
            $ref: '#/components/schemas/TestActionResponseInput'
        testType:
          type: string
          enum:
            - simulation
            - next_reply
            - tool_invocation
            - voice
        caller:
          description: >-
            How a voice test's simulated caller sounds and behaves. Voice tests
            are available to workspaces that have them turned on.
          type: object
          properties:
            voice:
              default: Kore
              type: string
              enum:
                - Kore
                - Aoede
                - Leda
                - Charon
                - Puck
                - Orus
            talkativeness:
              default: normal
              type: string
              enum:
                - short
                - normal
                - storyteller
            interruptions:
              default: sometimes
              type: string
              enum:
                - never
                - sometimes
                - often
            backchannels:
              default: true
              type: boolean
            hold:
              type: object
              properties:
                seconds:
                  type: integer
                  minimum: 5
                  maximum: 120
                returnLine:
                  type: string
                  maxLength: 500
              required:
                - seconds
            line:
              default: phone
              type: string
              enum:
                - clean
                - phone
            maxMinutes:
              default: 10
              type: integer
              minimum: 1
              maximum: 15
            direction:
              type: string
              enum:
                - inbound
                - outbound
        voiceChecks:
          description: >-
            Timing a voice test requires: the response gap's 90th percentile,
            the longest silence and how often the agent talks over the caller.
          type: object
          properties:
            maxResponseGapP90Seconds:
              type: number
              minimum: 0.5
              maximum: 30
            maxSilenceSeconds:
              type: integer
              minimum: 12
              maximum: 120
            ignoreSilenceDuringTools:
              type: boolean
            maxTalkOvers:
              type: integer
              minimum: 0
              maximum: 100
        messages:
          description: >-
            Context transcript. Next reply and tool invocation tests must end
            with a user message.
          maxItems: 100
          type: array
          items:
            $ref: '#/components/schemas/TestHistoryMessageInput'
        additionalCriteria:
          maxItems: 20
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 10000
        successExamples:
          maxItems: 20
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 10000
        failureExamples:
          maxItems: 20
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 10000
        expectedActionArguments:
          maxItems: 100
          type: array
          items:
            $ref: '#/components/schemas/TestArgumentAssertionInput'
        simulatorModel:
          description: >-
            `auto`, one of the default simulator models, or a `provider/model`
            ID from the model catalog.
          type: string
          minLength: 1
          maxLength: 150
        judgeModel:
          description: Evaluator model ID from the supported model catalog.
          type: string
          minLength: 1
          maxLength: 150
        matchAnyAction:
          description: >-
            For tool invocation tests, pass when at least one expected tool call
            and its arguments match. Forbidden tools still fail.
          type: boolean
        forbiddenActions:
          maxItems: 100
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 150
        mockStrategy:
          type: string
          enum:
            - all
            - none
            - selected
        mockFallback:
          type: string
          enum:
            - error
            - real
        mockedActions:
          maxItems: 100
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 150
      required:
        - name
        - maxTurns
        - expectedActions
        - actionResponses
    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
    TestEnvironmentInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 100
        variables:
          default: {}
          type: object
          propertyNames:
            type: string
            maxLength: 100
            pattern: ^[A-Za-z_][A-Za-z0-9_]*$
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
        connections:
          maxItems: 100
          type: array
          items:
            type: object
            properties:
              toolId:
                type: string
                minLength: 1
                maxLength: 200
              resourceId:
                type: string
                minLength: 1
                maxLength: 200
            required:
              - toolId
              - resourceId
      required:
        - name
    TestWorkflowTransition:
      type: object
      properties:
        agentId:
          description: >-
            The agent the node belongs to. Left out, it is on the agent under
            test. On another agent, the check is met by a transfer to that node.
          type: string
          minLength: 1
          maxLength: 200
        fromNodeId:
          anyOf:
            - type: string
              minLength: 1
              maxLength: 200
            - type: 'null'
        toNodeId:
          type: string
          minLength: 1
          maxLength: 200
      required:
        - toNodeId
    TestActionResponseInput:
      type: object
      properties:
        actionId:
          type: string
          minLength: 1
          maxLength: 150
        mode:
          type: string
          enum:
            - mock
            - live
        response:
          type: string
          maxLength: 50000
          description: A JSON-encoded response. In mock mode it must be valid JSON.
        isError:
          type: boolean
        when:
          description: >-
            Optional JSON object encoded as a string, matched exactly by named
            parameter.
          type: string
          maxLength: 50000
        conditions:
          maxItems: 100
          type: array
          items:
            $ref: '#/components/schemas/TestParameterAssertionInput'
      required:
        - actionId
        - mode
        - response
        - isError
    TestHistoryMessageInput:
      type: object
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
        content:
          type: string
          maxLength: 12000
          description: Required unless the row is a tool.
        tool:
          description: >-
            A tool the agent already ran. The agent is told about it, and it
            doesn't count as a call of the run. Assistant rows only.
          type: object
          properties:
            name:
              type: string
              minLength: 1
              maxLength: 200
            actionId:
              type: string
              minLength: 1
              maxLength: 200
            input:
              description: The tool's parameters as a JSON object.
              type: string
              maxLength: 50000
            output:
              type: string
              maxLength: 12000
              description: The tool's result. Empty when it wasn't recorded.
            isError:
              default: false
              type: boolean
          required:
            - name
            - input
            - output
      required:
        - role
        - content
    TestArgumentAssertionInput:
      type: object
      properties:
        actionId:
          type: string
          minLength: 1
          maxLength: 150
        validation:
          type: string
          enum:
            - exact
            - regex
            - llm
        arguments:
          default: '{}'
          description: >-
            A JSON object encoded as a string. Legacy validation applies to
            every parameter in this object.
          type: string
          maxLength: 50000
        parameters:
          maxItems: 100
          type: array
          items:
            $ref: '#/components/schemas/TestParameterAssertionInput'
      required:
        - actionId
    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'
    TestParameterAssertionInput:
      oneOf:
        - type: object
          properties:
            name:
              type: string
              minLength: 1
              maxLength: 150
            validation:
              type: string
              const: anything
            value:
              $ref: '#/components/schemas/JsonValue'
              default: null
              description: >-
                Optional for anything, which requires the named parameter to be
                present.
          required:
            - name
            - validation
        - type: object
          properties:
            name:
              type: string
              minLength: 1
              maxLength: 150
            validation:
              type: string
              enum:
                - exact
                - regex
                - llm
            value:
              $ref: '#/components/schemas/JsonValue'
          required:
            - name
            - validation
            - value
          description: >-
            `value` is the exact JSON value, a regex string, or an LLM
            requirement string.
  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.