> ## Documentation Index
> Fetch the complete documentation index at: https://test-8862363a-tembo-compute-backed-billing.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Trigger Agent

> Trigger an agent with an arbitrary JSON payload.



## OpenAPI

````yaml POST /agent/{keyOrId}/trigger
openapi: 3.1.0
info:
  title: Developer API
  description: Tembo Developer API
  version: 1.0.0
servers:
  - url: https://api.tembo.io/
    description: Tembo API
security: []
paths:
  /agent/{keyOrId}/trigger:
    post:
      summary: Trigger Agent
      description: >-
        Trigger an agent with an arbitrary JSON payload, which is passed to the
        agent as event context.


        You can identify the agent by either its UUID or its macro (key). The
        API key can be supplied via the `Authorization: Bearer` header or the
        `apiKey` query parameter.
      operationId: postPublic-apiAgentTrigger
      parameters:
        - name: keyOrId
          in: path
          description: >-
            The agent's UUID or its macro (key). You can find the UUID in the
            agent's properties panel.
          required: true
          schema:
            type: string
            example: a1b2c3d4-5678-9abc-def0-1234567890ab
        - name: apiKey
          in: query
          description: >-
            API key for authentication. Alternative to using the Authorization
            header.
          required: false
          schema:
            type: string
      requestBody:
        description: >-
          Arbitrary JSON payload passed to the agent as event context. Your
          agent instructions can reference any values in this payload.
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
              example:
                issue_url: https://github.com/org/repo/issues/42
                priority: high
        required: false
      responses:
        '200':
          description: Agent triggered successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    description: Unique identifier for the queued job
                  task:
                    type: string
                    description: The type of job that was queued
                    example: RunAgent
                  status:
                    type: string
                    description: Current status of the job
                    example: pending
                  priority:
                    type: integer
                    description: Job priority
                    example: 5
                  createdAt:
                    type: string
                    format: date-time
                  updatedAt:
                    type: string
                    format: date-time
                required:
                  - id
                  - task
                  - status
                  - priority
                  - createdAt
                  - updatedAt
        '404':
          description: >-
            Agent not found (no agent with the given key or ID exists in your
            organization)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Agent not found
                required:
                  - error
      x-codeSamples:
        - lang: bash
          label: Bearer Auth
          source: |-
            curl -s -X POST \
              "https://api.tembo.io/agent/${AGENT_ID}/trigger" \
              -H "Authorization: Bearer ${API_KEY}" \
              -H "Content-Type: application/json" \
              -d '{"issue_url": "https://github.com/org/repo/issues/42"}' | jq .
        - lang: bash
          label: Query Param Auth
          source: |-
            curl -s -X POST \
              "https://api.tembo.io/agent/${AGENT_ID}/trigger?apiKey=${API_KEY}" \
              -H "Content-Type: application/json" \
              -d '{"issue_url": "https://github.com/org/repo/issues/42"}' | jq .

````