# Run a data script on a Computer

> `POST` `/v1/computer-jobs`

URL: https://www.agencytitan.com/docs/tag/computers/POST/v1/computer-jobs

Operation ID: `computers_run_job`

Tag: [computers](https://www.agencytitan.com/docs/tag/computers.md)

## Description

Run long-running or bulk data scripts on a real isolated machine with network access and declared integration credentials. Use for migrations, imports, and data processing that should stay out of the conversation. Never use for small in-conversation transforms or calculations. Report only declared numeric counters through @at:progress and @at:result, with bounded progress messages and a bounded final summary; A finished job's read includes what it printed in its stored log, subject to job and source access: the whole log when it fits the AI inline limit; larger logs return the end and full byte count, with the whole log available through the authorized human download. The default is the cheapest disposable headless machine; a named terminal-capable Computer uses a new temporary account. AI-written code jobs must always declare execution_profile. Use execution_profile=pooled_node as the default choice for Node scripts using Node built-ins, npm/npx and the AgencyTitan platform API without external Computer tools; npm/npx dependencies must not require those tools. Choose execution_profile=computer only when required; explain in your plan which Python or Bash runtime, external tools such as Python/Git/curl, named Computer, input_files or output_files, MCP connections, or selected credentials require it. Omitting execution_profile keeps the Computer runtime for backward compatibility. Requires ai_config.use, the Agency AI gate, and computers.use for a named Computer. Requires a stable idempotency key: replay returns the same job only for the same request and acting identity. Returns a receipt. wait:true parks the AI until the job and its output capture finish and its log closes. A person's message during the wait ends it and returns interrupted_by_user with the job's current state; call computers_get_job with wait:true again to keep waiting. Declare input_files from an admitted AI workspace for private copies under AT_INPUTS_DIR. Declare sandbox-relative output_files for capture before cleanup; get_job_output returns private expiring links. Each captured output has a workspace_entry_id: read a text output with read_workspace using that id, and pass that id to tools that take a workspace file. input_files are copied to the Computer before the job starts and each must arrive within a few minutes, so use them for scripts, subtitles, data and other small files. For large video or audio, use the video operations (videos_trim, videos_merge, videos_compose and the others), which let the Computer download the media straight from storage. In your own job script there is no download command: either run an at-media spec (at-media run spec.json, where a stored file is referenced as {"storage_object_id":"<id>","filename":"clip.mp4"}; run at-media help first), or get a download link with get_file_links before starting the job and fetch it in the script with curl -L -o clip.mp4 "<link>". Validation returns 400, insufficient funds 402, denied access 403, unknown resources 404, and conflicting admission, computer_kind_unsupported, or credential_not_injectable 409.

## Parameters

- `Idempotency-Key` (header, required, `string`) — Caller-generated key for deterministic command replay (1-255 characters).

## Request body

- Required: yes
- Content-Type: `application/json`
  - Type: `allOf`
  - Properties:
    - `allowed_domains` (`array<string>`) — Optional restriction on public destinations; the platform API and the platform's file storage host remain reachable.
    - `computer_id` (`string`) — Optional existing terminal-capable Computer. Uses a new temporary account; omit for a disposable headless machine.
    - `cpu_kind` (`string`)
    - `cpus` (`integer`)
    - `credentials` (`array<oneOf>`) — Declared credential selectors. Environment names must be unique and cannot start with AT_.
    - `declared_counters` (`array<string>`) — Names of the only numeric counters the job may report (for example read, created, failed).
    - `execution_profile` (`string`) — AI authors must always declare execution_profile. Use pooled_node as the default choice for Node built-ins, npm/npx and…
    - `input_files` (`array<object>`) — Workspace files copied into the job inputs directory, available through AT_INPUTS_DIR. Requires an active admitted AI s…
    - `mcp_connections` (`array<object>`)
    - `memory_mb` (`integer`)
    - `output_files` (`array<object>`) — Files to capture before job cleanup. Paths are sandbox-relative without traversal; filenames must be unique. Outputs be…
    - `runtime` (`string`, required)
    - `script` (`string`, required) — Script source stored privately; never returned in a job result.
    - `tier` (`string`) — Disposable machine size. Omit for the cheapest headless shape.
    - `title` (`string`, required)
    - `wait` (`boolean`) — For an AI chat or workflow, true parks the AI until the job and its output capture finish; use it when the result is ne…

## Responses

- `201` (`application/json`): Successful response.
  - Type: `object`
  - Properties:
    - `data` (`object`, required)
- `400` (`application/json`): Request validation failed (unknown or out-of-range parameters/properties are rejected).
  - Type: `object`
  - Properties:
    - `error` (`object`, required)
- `401` (`application/json`): Missing, invalid, expired, or revoked bearer token.
  - Type: `object`
  - Properties:
    - `error` (`string`, required)
    - `error_description` (`string`, required)
- `403` (`application/json`): The authenticated user does not have permission for this operation.
  - Type: `object`
  - Properties:
    - `error` (`object`, required)
- `404` (`application/json`): The requested resource was not found.
  - Type: `object`
  - Properties:
    - `error` (`object`, required)
- `409` (`application/json`): The request conflicts with an existing record or partially applied.
  - Type: `object`
  - Properties:
    - `error` (`object`, required)
- `429` (`application/json`): Per-tenant rate limit exceeded (600 requests/minute across all /v1 REST endpoints). The Retry-After header indicates how many seconds to wait.
  - Type: `object`
  - Properties:
    - `error` (`object`, required)
- `500` (`application/json`): An unexpected internal error occurred.
  - Type: `object`
  - Properties:
    - `error` (`object`, required)

## Authentication

- `bearerAuth` — http (bearer) — All /v1 endpoints (except `/v1/openapi.json` and `/v1/llms.txt`) require a bearer token. Two equal first-class paths: (1) an OAuth 2.0 access token from the au…

## Useful links

- Interactive page: https://www.agencytitan.com/docs/tag/computers/POST/v1/computer-jobs
- API reference home: https://www.agencytitan.com/docs/
- Tag page: https://www.agencytitan.com/docs/tag/computers.md
- This operation as Markdown: https://www.agencytitan.com/docs/tag/computers/POST/v1/computer-jobs.md
- OpenAPI JSON: https://www.agencytitan.com/docs/openapi.json
- Full API Markdown: https://api.agencytitan.com/v1/llms.txt
- API keys: https://app.agencytitan.com/settings/api-mcp
