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

# Run Test by ID API

> Execute a specific test by its ID and start a test run.



## OpenAPI

````yaml post /test/{test_id}/run
openapi: 3.0.3
info:
  title: Autonoma API
  description: |
    API for managing test runs and test definitions in the Autonoma platform.

    **Important Note:** Media URLs (images, videos) expire after 1 hour.
  version: 1.0.0
  contact:
    name: Autonoma Support
servers:
  - url: https://autonoma.app/api
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /test/{test_id}/run:
    post:
      summary: Run test
      description: Run a test by test ID
      parameters:
        - name: test_id
          in: path
          required: true
          description: ID of the test to run
          schema:
            type: string
            example: g41k688vndxzt7kh4kq5m12s
      requestBody:
        required: false
        description: Request body (optional)
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunTestRequest'
      responses:
        '200':
          description: Run creation result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunTest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidCredentialsError'
        '404':
          description: Test not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
      security:
        - ApiKeyAuth: []
          ApiSecretAuth: []
components:
  schemas:
    RunTestRequest:
      type: object
      required:
        - id
      properties:
        application_version_id:
          type: string
          description: Optional application version ID to use for the test run
          example: cm7dbowr80042waka7thyjhkq
        source:
          type: string
          description: Source of the test run request
          default: api
          example: api
        runtime_metadata:
          type: object
          description: >-
            Variables to override when test is running, if variable does not
            match any of your saved variables it will ignore it
          additionalProperties:
            type: string
          example:
            NAME: CompanyName
            ENVIRONMENT: staging
            API_KEY: test-key-123
    RunTest:
      type: object
      properties:
        message:
          type: string
          example: Test created successfully
        url:
          type: string
          example: https://autonoma.app/run/pby4qnbppbvimimuls4v5ajq
        run_id:
          type: string
          example: pby4qnbppbvimimuls4v5ajq
    InvalidCredentialsError:
      type: object
      properties:
        error:
          type: string
          example: Unauthorized
        message:
          type: string
          example: Invalid authentication credentials
    NotFoundError:
      type: object
      properties:
        error:
          type: string
          example: Not found
        message:
          type: string
          example: Resource with id `cm8d9gt6v000c9fe5glmyi33u` not found
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: autonoma-client-id
      description: Client ID for authentication
    ApiSecretAuth:
      type: apiKey
      in: header
      name: autonoma-client-secret
      description: Client secret for authentication

````