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

# Submit Agent Event

> Submits a business event for a consumer and enqueues it for asynchronous agent processing. The immediate response contains `status` and `agent_event_id` for later polling.



## OpenAPI

````yaml /openapi/endpoints/meta-business-agent-public.openapi.json post /metaBusinessAgents/{entityId}/events
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}/events:
    post:
      tags:
        - Meta Business Agents
      summary: Submit Agent Event
      description: >-
        Submits a business event for a consumer and enqueues it for asynchronous
        agent processing. The immediate response contains `status` and
        `agent_event_id` for later polling.
      operationId: meta-business-agent-submit-agent-event
      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/PublicSubmitAgentEventRequest'
      responses:
        '200':
          description: Operation completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentEventResultDTO'
        '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:
    PublicSubmitAgentEventRequest:
      type: object
      properties:
        to:
          type: string
          minLength: 1
        event:
          $ref: '#/components/schemas/AgentEventDTO'
      required:
        - to
        - event
      additionalProperties: false
    AgentEventResultDTO:
      type: object
      properties:
        status:
          type: string
          enum:
            - accepted
          description: Initial event processing status returned by Meta.
        agent_event_id:
          type: string
          description: ID used to poll event processing status.
      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'
    AgentEventDTO:
      type: object
      properties:
        type:
          type: string
          minLength: 1
          maxLength: 256
          description: Stable business event type, up to 256 characters.
        description:
          type: string
          minLength: 1
          maxLength: 1024
          description: Plain-language meaning of the event, up to 1,024 characters.
        payload:
          type: string
          minLength: 1
          maxLength: 4096
          description: Opaque JSON serialized as a string, up to 4,096 characters.
      additionalProperties: false
      required:
        - type
        - description
        - payload
    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.