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

# Test Agent

> Sends `user_msg` through the full agent pipeline and returns a synchronous test response without requiring a real consumer number. Reuse the optional `conversation_id` to continue a multi-turn test.



## OpenAPI

````yaml /openapi/endpoints/meta-business-agent-public.openapi.json post /metaBusinessAgents/{entityId}/tests
openapi: 3.0.0
info:
  title: YCloud Meta Business Agent Public API
  version: v2
  description: >-
    Create, configure, test, and operate a Meta Business Agent for a WhatsApp
    Business phone number through YCloud.
servers:
  - url: https://api.ycloud.com/v2
    description: YCloud API base URL
security:
  - api_key: []
tags:
  - name: Meta Business Agents
    description: >-
      Meta Business Agent onboarding, knowledge, skills, connectors, tools,
      operations, and evaluations.
paths:
  /metaBusinessAgents/{entityId}/tests:
    post:
      tags:
        - Meta Business Agents
      summary: Test Agent
      description: >-
        Sends `user_msg` through the full agent pipeline and returns a
        synchronous test response without requiring a real consumer number.
        Reuse the optional `conversation_id` to continue a multi-turn test.
      operationId: meta-business-agent-test-agent
      parameters:
        - name: entityId
          in: path
          required: true
          schema:
            type: string
          description: WhatsApp Business Phone Number ID that owns the Meta Business Agent.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicTestAgentRequest'
      responses:
        '200':
          description: Operation completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentTestResultDTO'
        '400':
          description: Request failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetaBusinessAgentErrorResponse'
        '401':
          description: Request failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetaBusinessAgentErrorResponse'
        '403':
          description: Request failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetaBusinessAgentErrorResponse'
        '404':
          description: Request failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetaBusinessAgentErrorResponse'
        '409':
          description: Request failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetaBusinessAgentErrorResponse'
        '429':
          description: Request failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetaBusinessAgentErrorResponse'
        '500':
          description: Request failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetaBusinessAgentErrorResponse'
        '502':
          description: Request failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetaBusinessAgentErrorResponse'
components:
  schemas:
    PublicTestAgentRequest:
      type: object
      properties:
        user_msg:
          type: string
          minLength: 1
          description: Customer message to send to the test agent.
        conversation_id:
          type: string
          description: Conversation context ID returned by a previous test turn.
      required:
        - user_msg
      additionalProperties: false
    AgentTestResultDTO:
      type: object
      properties:
        message_id:
          type: string
          description: Meta message ID for the generated test response.
        agent_response:
          type: string
          description: Generated response text.
        conversation_id:
          type: string
          description: Conversation context ID to pass on subsequent test turns.
        timestamp:
          type: integer
          format: int64
          description: Unix timestamp in seconds.
        handoff_reason:
          type: string
          description: Reason the agent decided a human should take over, when present.
        no_response_reason:
          type: string
          description: Reason the agent produced no response, when present.
        quick_replies:
          type: array
          items:
            type: string
          description: Suggested quick-reply labels, when present.
        product_variant_ids:
          type: array
          items:
            type: string
          description: Product variant IDs referenced by the response, when present.
      additionalProperties: false
    MetaBusinessAgentErrorResponse:
      type: object
      additionalProperties: true
      properties:
        status:
          type: integer
        code:
          type: string
        message:
          type: string
        target:
          type: string
        docUrl:
          type: string
        requestId:
          type: string
        metaBusinessAgentApiError:
          $ref: '#/components/schemas/MetaBusinessAgentApiError'
    MetaBusinessAgentApiError:
      type: object
      additionalProperties: false
      properties:
        title:
          type: string
          description: Meta error title, when available.
        detail:
          type: string
          description: Actionable Meta error detail, when available.
        type:
          type: string
          description: Meta error category or URI, when available.
        status:
          type: integer
          description: Upstream HTTP status.
        requestId:
          type: string
          description: Upstream request identifier.
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: X-API-Key

````

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