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

# Run Agent Async

> Run agent asynchronously. Returns agent job id which can be used to check status and get results.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url "https://api.roe-ai.com/v1/agents/run/YOUR_AGENT_ID/async/" \
    --header "Authorization: Bearer YOUR_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
      "inputs": {
        "key": "value"
      }
    }'
  ```
</RequestExample>


## OpenAPI

````yaml POST /v1/agents/run/{agent_id}/async/
openapi: 3.1.0
info:
  title: Roe AI API
  version: 1.0.0
  description: Complete API documentation for Roe AI platform
servers:
  - url: https://api.roe-ai.com
    description: Production API
security: []
paths:
  /v1/agents/run/{agent_id}/async/:
    post:
      tags:
        - v1
      description: >-
        Run agent asynchronously. Returns agent job id which can be used to
        check status and get results.
      operationId: v1_agents_run_async_create
      parameters:
        - in: path
          name: agent_id
          schema:
            type: string
            format: uuid
          required: true
        - name: organization_id
          in: query
          required: false
          schema:
            type: string
            format: uuid
          description: >-
            Organization ID. This is required for access control. It can be
            provided via query or request body depending on the endpoint.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentExecutionRequestRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                type: string
              examples:
                Example:
                  value: 123e4567-e89b-12d3-a456-426614174000
          description: Agent job ID
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Example:
                  value:
                    error: Invalid agent input data
          description: Invalid request data or agent input validation error
        '402':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Example:
                  value:
                    error: Insufficient credits
                    status_code: 402
          description: Insufficient credits
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Example:
                  value:
                    error: You don't have access to agents feature
          description: >-
            Access to the Agents feature is forbidden or permission to access
            this agent denied
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Example:
                  value:
                    error: Agent not found
          description: Agent not found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Example:
                  value:
                    error: Internal server error
          description: Internal server error
components:
  schemas:
    AgentExecutionRequestRequest:
      type: object
      description: Serializer for agent execution requests with dynamic input fields.
      properties:
        metadata:
          description: Optional metadata as JSON object or JSON string
        agent_input_key_example:
          type: string
          minLength: 1
          description: >-
            Agent input keys are dynamic based on agent configuration. Can be
            text or file.
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Error message
      required:
        - message

````