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

# Get a run

> While the run is open, trace and evaluation are null. Reading also ends a run that is due.



## OpenAPI

````yaml /openapi.json get /v1/runs/{id}
openapi: 3.1.0
info:
  title: testworld API
  version: 1.0.0
  description: >-
    Start a run on a simulated workplace, point your agent at its tools, and
    read back the trace and the evaluation. The hosted API opens with early
    access.
  x-fingerprint: d223e1b42e3f0279
servers:
  - url: https://api.testworld.dev
    description: Hosted, opens with early access
security:
  - bearer: []
paths:
  /v1/runs/{id}:
    get:
      tags:
        - Runs
      summary: Get a run
      description: >-
        While the run is open, trace and evaluation are null. Reading also ends
        a run that is due.
      operationId: getRun
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The run id.
      responses:
        '200':
          description: The run, without its token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Run'
        '401':
          description: No key, or a wrong one.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such run.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Run:
      type: object
      description: One agent doing one task in one environment.
      properties:
        id:
          type: string
          description: Opaque id, starts with run_.
        status:
          type: string
          enum:
            - created
            - running
            - evaluating
            - done
            - failed
        ended_by:
          type:
            - string
            - 'null'
          enum:
            - finish
            - idle_timeout
            - timeout
            - max_calls
            - null
        error:
          type:
            - object
            - 'null'
          properties:
            type:
              type: string
            message:
              type: string
        environment:
          type: object
          properties:
            id:
              type: string
            slug:
              type: string
            version:
              type: object
              properties:
                id:
                  type: string
                number:
                  type: integer
        task:
          type: object
          properties:
            id:
              type:
                - string
                - 'null'
            text:
              type: string
        agent:
          type: object
          properties:
            name:
              type:
                - string
                - 'null'
            revision:
              type:
                - string
                - 'null'
        tools_url:
          type: string
          description: The agent's base address for the tools.
        mcp_url:
          type: string
          description: One MCP address for the Gmail and Slack tools.
        tools:
          type: array
          items:
            $ref: '#/components/schemas/ToolAddress'
        token:
          type: string
          description: >-
            The run's credential for the tools, tw_run_... Only in the answers
            of POST /v1/runs and GET /v1/runs/{id}/tools.
        now:
          type: string
          format: date-time
          description: Simulated time after the last call.
        calls:
          type: integer
        max_calls:
          type: integer
        idle_timeout_seconds:
          type: integer
        timeout_seconds:
          type: integer
        created_at:
          type: string
          format: date-time
        started_at:
          type:
            - string
            - 'null'
          format: date-time
        expires_at:
          type: string
          format: date-time
        finished_at:
          type:
            - string
            - 'null'
          format: date-time
        scored_at:
          type:
            - string
            - 'null'
          format: date-time
        metadata:
          type: object
        trace:
          oneOf:
            - $ref: '#/components/schemas/Trace'
            - type: 'null'
        evaluation:
          oneOf:
            - $ref: '#/components/schemas/Evaluation'
            - type: 'null'
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - message
          properties:
            type:
              type: string
              enum:
                - invalid_request
                - unauthorized
                - not_found
                - run_ended
                - idempotency_conflict
                - rate_limited
              description: Stable. Use it in code.
            message:
              type: string
              description: For people. It can change.
    ToolAddress:
      type: object
      properties:
        provider:
          type: string
          enum:
            - google.gmail
            - slack
            - google.calendar
        surface:
          type: string
          enum:
            - rest
            - web-api
            - mcp
        url:
          type: string
          description: Absolute address.
    Trace:
      type: object
      description: >-
        Every call the tools answered during the run, reads included. Nothing
        from inside the agent.
      properties:
        calls:
          type: array
          items:
            $ref: '#/components/schemas/TraceCall'
    Evaluation:
      type: object
      description: The end state and the output compared with the run's checks.
      properties:
        score:
          type:
            - number
            - 'null'
          minimum: 0
          maximum: 1
          description: Passed checks over all checks. null when the run had no checks.
        passed:
          type:
            - boolean
            - 'null'
          description: true only when every check passed.
        checks:
          type: array
          items:
            $ref: '#/components/schemas/CheckResult'
        state_diff:
          type: object
          description: 'Per collection: created, updated and removed ids.'
        evaluated_at:
          type: string
          format: date-time
    TraceCall:
      type: object
      properties:
        seq:
          type: integer
          minimum: 1
        at:
          type: string
          format: date-time
          description: Simulated time.
        provider:
          type: string
        surface:
          type: string
        operation:
          type: string
          description: >-
            For example gmail.messages.list or slack.chat.postMessage. On MCP it
            is the tool's name.
        arguments:
          type: object
          description: >-
            Path, query and body merged for REST and Web API calls. The tool
            arguments for MCP.
        result:
          description: The body the tool answered.
        status:
          type: string
          enum:
            - ok
            - error
        error:
          type:
            - object
            - 'null'
          properties:
            type:
              type: string
            message:
              type: string
        mutated:
          type: boolean
          description: Whether the call changed the environment.
        state_digest:
          type: string
        reactions:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              user:
                type: string
              ts:
                type: string
              text:
                type: string
    CheckResult:
      type: object
      properties:
        id:
          type: string
        kind:
          type: string
        description:
          type: string
        source:
          type: string
          enum:
            - template
            - custom
        passed:
          type:
            - boolean
            - 'null'
          description: null when undecided, which counts as not passed.
        explanation:
          type: string
          description: One line on what was found.
        judge:
          type:
            - object
            - 'null'
          properties:
            model:
              type: string
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: Your API key. Tool calls under tools_url use the run token instead.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.