Skip to main content
POST
Build a routine

Authorizations

Authorization
string
header
required

Secret key (sk_live_...)

Headers

Idempotency-Key
string

Optional key that makes the request idempotent. Retrying with the same key returns the original response instead of repeating the operation; keys expire after 24 hours. Any string up to 256 characters. See Idempotency.

Maximum string length: 256
Example:

"550e8400-e29b-41d4-a716-446655440000"

Path Parameters

routine_id
string
required

Unique identifier for the routine (prefixed with rtn_).

Pattern: ^rtn_
Example:

"rtn_AbC123xYz456"

Body

Request body for starting a routine build.

credential_id
null | string

ID of the credential the build logs in with (prefixed with cred_). Must belong to the routine's source. Required when the source requires login.

Example:

"cred_AbC123xYz456"

input
null | any

Example input for the task. Validated against the task's input_schema the same way as a task run. Required when the task has required inputs.

instructions
null | string

Plain-text guidance for the build, up to 10,000 characters.

Maximum string length: 10000
Example:

"Pull bills from the Billing History page, not the dashboard."

Response

Accepted

A routine build: Deck writing the Playwright code for one routine. A build is not a task run.

id
string
required

Unique identifier for the routine build (prefixed with rbld_).

Example:

"rbld_AbC123xYz456"

object
string
required

Always routine_build.

routine_id
string
required

The routine being built (prefixed with rtn_).

Example:

"rtn_AbC123xYz456"

task_id
string
required

The routine's task (prefixed with task_).

Example:

"task_AbC123xYz456"

source_id
string
required

The routine's source (prefixed with src_).

Example:

"src_AbC123xYz456"

status
enum<string>
required

Current status of the build.

Available options:
queued,
running,
interaction_required,
completed,
failed,
canceling,
canceled
created_at
string<date-time>
required

ISO 8601 timestamp of when the build was created.

Example:

"2026-11-05T16:41:03Z"

updated_at
string<date-time>
required

ISO 8601 timestamp of when the build was last updated.

Example:

"2026-11-05T16:41:03Z"

credential_id
null | string

The credential the build logs in with (prefixed with cred_).

session_id
null | string

The session the build logged in to (prefixed with sess_). null until login finishes. The session ends when the build ends.

live_view_url
null | string

Read-only view of the build's browser while it's running or interaction_required, null otherwise. Returned only when retrieving a single build. Carries a token, so treat it like an API key. Always null for a sensitive task.

version
null | integer

The routine version this build saved. null until completed.

instructions
null | string

The instructions the build was started with.

errors
null | object[]

Error details if the build failed. Same structure as task run errors. Includes routine_build_failed when Deck couldn't produce a routine.

interaction
null | any

Interaction details while the build is interaction_required, such as an MFA code request. Same structure as on a task run. Set only when retrieving a single build or submitting an interaction, and null in lists.

runtime_ms
null | integer

Execution time in milliseconds.

input
null | any

The build's input. Returned only with include=input. Tokenized fields are removed.

tokenized
null | string[]

Names of input fields whose values were tokenized when the build started. Names only, never values. Omitted when no fields were tokenized.

browser
null | object

Browser files captured during the build. Returned only when include=browser is requested. Same structure as on a task run.

request_id
null | string

Unique identifier for the API request.