---
title: "Retrieve execution"
method: GET
path: "/v1/executions/{id}"
tags: ["Execution"]
---

# Retrieve execution

`GET /v1/executions/{id}`

Retrieves an execution.

## Path parameters

- `id` string, required

## Response `200`

OK

- Execution
  - `details` union
    - ToolExecutionDetails
      - `request` ExecuteToolRequest, required
        - `env` EnvVar[] — Set of key-value pairs to add to the tool's execution environment.
          - `name` string, required
          - `secret_id` string
          - `value` string
        - `http` HTTPTool — Configuration for HTTP requests and authentication.
          - `allow` HTTPToolAllow[] — List of allowed HTTP hosts and associated authentication.
            - `auth` HTTPToolAuth — Authentication configuration for outbound requests to this host.
              - …
            - `host` string — The hostname to allow.
        - `input` unknown
        - `revision_id` string — The Tool revision ID to execute. This optional parmeter is used to pin executions to specific versions of the Tool. If not provided, the latest (current) version of the Tool will be executed.
      - `response` ExecuteToolResponse, required
        - `execution` ExecutionResult, required — The execution details of the function.
          - `duration` integer, required — The execution time of the function in milliseconds.
          - `exit_code` integer, required — The exit code returned by the function. Will often be '0' on success and non-zero on failure.
          - `id` string, required — The ID of the execution.
          - `stderr` string, required — The contents of 'stderr' after executing the function.
          - `stdout` string, required — The contents of 'stdout' after executing the function.
        - `output` unknown, required
        - `output_status` 'error' | 'json_serialization_error' | 'valid', required — The status of the output. "valid" means your Tool executed successfully and returned a valid JSON-serializable object, or void. "json_serialization_error" means your Tool executed successfully, but returned a nonserializable object. "error" means your Tool failed to execute.
      - `tool_id` string, required
      - `type` 'tool', required
    - FunctionExecutionDetails
      - `request` ExecuteFunctionRequest, required
        - `code` string, required — The function to execute. Your code must define a function named "execute" that takes in a single argument and returns a JSON-serializable value.
        - `env` object — Set of key-value pairs to add to the function's execution environment.
        - `files` File[] — List of input files.
          - `contents` string — The contents of the file.
          - `path` string — The relative path of the file.
        - `http` HTTP — Configuration for HTTP requests and authentication.
          - `allow` HTTPAllow[] — List of allowed HTTP hosts and associated authentication.
            - `auth` HTTPAuth — Authentication configuration for outbound requests to this host.
              - …
            - `host` string — The hostname to allow.
        - `input` unknown
        - `language` 'python' | 'javascript' | 'typescript', required — The interpreter to use when executing code.
        - `limits` Limits — Configuration for execution environment limits.
          - `execution_timeout` integer — The maximum time allowed for execution (in seconds). Default is 30.
          - `memory_size` integer — The maximum memory allowed for execution (in MiB). Default is 128.
        - `runtime_revision_id` string — The ID of the runtime revision to use when executing code.
      - `response` ExecuteFunctionResponse, required
        - `execution` ExecutionResult, required — The execution details of the function.
          - `duration` integer, required — The execution time of the function in milliseconds.
          - `exit_code` integer, required — The exit code returned by the function. Will often be '0' on success and non-zero on failure.
          - `id` string, required — The ID of the execution.
          - `stderr` string, required — The contents of 'stderr' after executing the function.
          - `stdout` string, required — The contents of 'stdout' after executing the function.
        - `output` unknown, required
        - `output_status` 'error' | 'json_serialization_error' | 'valid', required — The status of the output. "valid" means your function executed successfully and returned a valid JSON-serializable object, or void. "json_serialization_error" means your function executed successfully, but returned a nonserializable object. "error" means your function failed to execute.
      - `type` 'function', required
    - ScriptExecutionDetails
      - `request` ExecuteRequest, required
        - `args` string[] — List of command line arguments to pass to the script.
        - `code` string, required — The code to execute.
        - `env` object — Set of key-value pairs to add to the script's execution environment.
        - `files` File[] — List of input files.
          - `contents` string — The contents of the file.
          - `path` string — The relative path of the file.
        - `http` HTTP — Configuration for HTTP requests and authentication.
          - `allow` HTTPAllow[] — List of allowed HTTP hosts and associated authentication.
            - `auth` HTTPAuth — Authentication configuration for outbound requests to this host.
              - …
            - `host` string — The hostname to allow.
        - `language` 'python' | 'javascript' | 'typescript' | 'ruby' | 'php', required — The interpreter to use when executing code.
        - `limits` Limits — Configuration for execution environment limits.
          - `execution_timeout` integer — The maximum time allowed for execution (in seconds). Default is 30.
          - `memory_size` integer — The maximum memory allowed for execution (in MiB). Default is 128.
        - `runtime_revision_id` string — The ID of the runtime revision to use when executing code.
        - `stdin` string — Input made available to the script via 'stdin'.
      - `response` ExecuteResponse, required
        - `duration` integer, required — The execution time of the script in milliseconds.
        - `exit_code` integer, required — The exit code returned by the script. Will often be '0' on success and non-zero on failure.
        - `id` string, required — The ID of the execution.
        - `stderr` string, required — The contents of 'stderr' after executing the script.
        - `stdout` string, required — The contents of 'stdout' after executing the script.
      - `type` 'script', required
  - `duration` integer, required
  - `exit_code` integer, required
  - `id` string, required
  - `language` 'python' | 'javascript' | 'typescript' | 'ruby' | 'php', required
  - `started_at` string, date-time, required

## Other responses

- `401` — Unauthenticated error response

---

[API](https://skmtc.net/riza-io/apis/execute.md) · [All operations](https://skmtc.net/riza-io/apis/execute/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/riza-io/execute/versions/bab65e0b0c2b/schema)
