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

# Execute Trigger

> Execute a trigger with the provided event data.

Called by the Go event service when a polling channel receives new messages.
Builds trigger data from the events and channel origin, then creates and
submits a task for agent execution.

Args:
    trigger_id: The unique identifier of the trigger
    request: Events and channel origin data
    http_request: Raw request, used to verify the internal service token
    trigger_service: Injected trigger service

Returns:
    Execution result with task ID

Raises:
    HTTPException: If trigger not found or execution fails



## OpenAPI

````yaml /api-reference/openapi.json post /v1/triggers/{trigger_id}/execute
openapi: 3.1.0
info:
  description: >-
    Modular and extensible framework for building AI agents. This API requires
    JWT Bearer token authentication for most endpoints. Include your JWT token
    in the Authorization header. Public endpoints include /, /health, /docs,
    /redoc, and /openapi.json.
  title: AgentArea API
  version: 0.1.0
servers: []
security:
  - bearer: []
paths:
  /v1/triggers/{trigger_id}/execute:
    post:
      tags:
        - v1
        - public
        - triggers
      summary: Execute Trigger
      description: >-
        Execute a trigger with the provided event data.


        Called by the Go event service when a polling channel receives new
        messages.

        Builds trigger data from the events and channel origin, then creates and

        submits a task for agent execution.


        Args:
            trigger_id: The unique identifier of the trigger
            request: Events and channel origin data
            http_request: Raw request, used to verify the internal service token
            trigger_service: Injected trigger service

        Returns:
            Execution result with task ID

        Raises:
            HTTPException: If trigger not found or execution fails
      operationId: execute_trigger_v1_triggers__trigger_id__execute_post
      parameters:
        - in: path
          name: trigger_id
          required: true
          schema:
            format: uuid
            title: Trigger Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TriggerExecuteRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: true
                title: Response Execute Trigger V1 Triggers  Trigger Id  Execute Post
                type: object
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    TriggerExecuteRequest:
      description: Request model for executing a trigger via the event service.
      properties:
        channel_origin:
          additionalProperties: true
          title: Channel Origin
          type: object
        events:
          items:
            additionalProperties: true
            type: object
          title: Events
          type: array
      title: TriggerExecuteRequest
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearer:
      bearerFormat: JWT
      description: JWT Bearer token for authentication
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````