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

# Retrieve a routine build

> Returns a single routine build.



## OpenAPI

````yaml /api-reference/v2.json get /routine-builds/{routine_build_id}
openapi: 3.1.1
info:
  title: Deck API
  version: 2.0.0
servers:
  - url: https://api.deck.co/v2
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Agents
    description: >-
      Agents are the AI workers that execute tasks against sources. Create and
      manage the agents in your organization.
  - name: Components
    description: >-
      Embeddable UI components. Create short-lived session tokens for the Auth
      Component.
  - name: Platform
    description: Organization-wide platform settings, such as the static IP range.
  - name: Credentials
    description: >-
      Credentials store the login details an agent uses at a source. Values are
      tokenized at rest and never returned in plaintext.
  - name: Event Destinations
    description: >-
      Where Deck delivers events: webhooks, SQS, Kinesis, S3, and more. Manage
      destinations and inspect delivery attempts.
  - name: Events
    description: >-
      Immutable records of things that happened in your organization, such as a
      task run completing or a credential being verified.
  - name: Sessions
    description: >-
      Sessions are agent sandbox lifetimes. A session is created for each task
      run (or explicitly) and counts toward your concurrency limit.
  - name: Sources
    description: >-
      Sources are the websites and portals agents work against. Register,
      inspect, reset, and delete them.
  - name: Storage
    description: >-
      Files produced by task runs: downloaded documents, exports, and extraction
      results.
  - name: Task Runs
    description: >-
      A task run is one execution of a task. Inspect status and output, retrieve
      files and screenshots, cancel runs, and answer interaction requests.
  - name: Tasks
    description: >-
      Tasks define reusable units of work for an agent: a goal, an input schema,
      and an output schema. Run them against sources with credentials.
  - name: Test
    description: Connectivity check for your API key.
  - name: Routines
    description: >-
      Routines set how a task runs on a source: with your own Playwright code,
      or with the Deck agent.
  - name: Routine Builds
    description: >-
      Routine builds are Deck writing the Playwright code for a routine. Start
      one with `POST /v2/routines/{routine_id}/build`.
  - name: Triggers
    description: Triggers run tasks automatically on a schedule or in response to events.
  - name: Workflows
  - name: Workflow Runs
paths:
  /routine-builds/{routine_build_id}:
    get:
      tags:
        - Routine Builds
      summary: Retrieve a routine build
      description: Returns a single routine build.
      operationId: getRoutineBuild
      parameters:
        - name: routine_build_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^rbld_
            example: rbld_AbC123xYz456
          description: Unique identifier for the routine build (prefixed with `rbld_`).
        - name: include
          in: query
          required: false
          schema:
            type: string
            example: input,browser
          description: >-
            Comma-separated optional sections to include: `input`, `browser`.
            Sections are omitted from the response (not returned as null) when
            their flag is not present.
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/RoutineBuildResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/RoutineBuildResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/RoutineBuildResponse'
        '400':
          description: Bad request — validation error or malformed input.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: 'Not found: the routine build does not exist (`resource_not_found`).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            Too many requests — the organization-wide API rate limit was
            exceeded (`rate_limit_exceeded`). Retry with exponential backoff.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    RoutineBuildResponse:
      required:
        - id
        - object
        - routine_id
        - task_id
        - source_id
        - status
        - created_at
        - updated_at
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the routine build (prefixed with `rbld_`).
          example: rbld_AbC123xYz456
        object:
          type: string
          description: Always `routine_build`.
        routine_id:
          type: string
          description: The routine being built (prefixed with `rtn_`).
          example: rtn_AbC123xYz456
        task_id:
          type: string
          description: The routine's task (prefixed with `task_`).
          example: task_AbC123xYz456
        source_id:
          type: string
          description: The routine's source (prefixed with `src_`).
          example: src_AbC123xYz456
        credential_id:
          type:
            - 'null'
            - string
          description: The credential the build logs in with (prefixed with `cred_`).
        session_id:
          type:
            - 'null'
            - string
          description: >-
            The session the build logged in to (prefixed with `sess_`). `null`
            until login finishes. The session ends when the build ends.
        live_view_url:
          type:
            - 'null'
            - string
          description: >-
            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.
        status:
          enum:
            - queued
            - running
            - interaction_required
            - completed
            - failed
            - canceling
            - canceled
          type: string
          description: Current status of the build.
        version:
          type:
            - 'null'
            - integer
          description: The routine version this build saved. `null` until `completed`.
        instructions:
          type:
            - 'null'
            - string
          description: The instructions the build was started with.
        errors:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/TaskRunError'
          description: >-
            Error details if the build failed. Same structure as task run
            errors. Includes `routine_build_failed` when Deck couldn't produce a
            routine.
        interaction:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/JsonElement'
          description: >-
            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:
          type:
            - 'null'
            - integer
          description: Execution time in milliseconds.
        input:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/JsonElement'
          description: >-
            The build's input. Returned only with `include=input`. Tokenized
            fields are removed.
        tokenized:
          type:
            - 'null'
            - array
          items:
            type: string
          description: >-
            Names of input fields whose values were tokenized when the build
            started. Names only, never values. Omitted when no fields were
            tokenized.
        browser:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/TaskRunBrowserData'
          description: >-
            Browser files captured during the build. Returned only when
            `include=browser` is requested. Same structure as on a task run.
        created_at:
          type: string
          format: date-time
          example: '2026-11-05T16:41:03Z'
          description: ISO 8601 timestamp of when the build was created.
        updated_at:
          type: string
          format: date-time
          example: '2026-11-05T16:41:03Z'
          description: ISO 8601 timestamp of when the build was last updated.
        request_id:
          type:
            - 'null'
            - string
          description: Unique identifier for the API request.
      description: >-
        A routine build: Deck writing the Playwright code for one routine. A
        build is not a task run.
    ValidationErrorResponse:
      required:
        - errors
      type: object
      properties:
        type:
          type:
            - 'null'
            - string
          description: RFC 9110 problem type URI.
        title:
          type:
            - 'null'
            - string
          description: Short summary of the validation failure.
        status:
          type:
            - 'null'
            - integer
          description: HTTP status code.
          format: int32
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Validation errors grouped by field name.
        traceId:
          type:
            - 'null'
            - string
          description: Request trace identifier.
      description: Validation error returned for malformed requests (HTTP 400).
    ErrorResponse:
      required:
        - errors
        - request_id
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/TaskRunError'
          description: One or more errors that describe what went wrong.
        request_id:
          type: string
          description: Unique identifier for this request, useful for tracing.
      description: Standard error response.
    TaskRunError:
      required:
        - type
        - code
        - message
      type: object
      properties:
        type:
          type: string
          description: >-
            Error category (e.g. `source`, `auth`, `task`, `rate_limit`).
            Determines the class of failure.
        code:
          type: string
          description: Machine-readable error code. Use this for programmatic handling.
        message:
          type: string
          description: >-
            Human-readable explanation. Do not rely on this for logic — it may
            change.
        field:
          type:
            - 'null'
            - string
          description: The input field that caused the error, when applicable.
        policy:
          $ref: '#/components/schemas/TaskPolicy'
          description: On a `policy` error, the policy that was broken.
      description: Error details for a failed task run. Same structure as API-level errors.
    JsonElement:
      description: Arbitrary JSON value.
    TaskRunBrowserData:
      type: object
      properties:
        logs_truncated:
          type: boolean
          description: >-
            `true` if the run hit a capture limit and later log entries were
            dropped.
        dom:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/TaskRunBrowserDom'
          description: The final page's HTML. Omitted until the run finishes or pauses.
        har:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/TaskRunBrowserHar'
          description: >-
            The run's network requests as a HAR file. Omitted until the run
            finishes.
      description: Browser files captured during the run.
    TaskPolicy:
      oneOf:
        - title: Payment
          type: object
          required:
            - type
            - amount_max
          properties:
            type:
              type: string
              enum:
                - payment
            amount_max:
              type: number
              minimum: 0
              description: >-
                Maximum amount for a single payment. There is no currency
                conversion.
          additionalProperties: false
          description: No single payment above `amount_max`.
        - title: Volume
          type: object
          required:
            - type
            - commits_max
          properties:
            type:
              type: string
              enum:
                - volume
            commits_max:
              type: integer
              minimum: 0
              description: >-
                Maximum payments, deletions, cancellations, and terms
                acceptances per run, counted together. Other submits, updates,
                and uploads don't count, and a review step and its confirmation
                count as one.
          additionalProperties: false
          description: >-
            No more than `commits_max` payments, deletions, cancellations, and
            terms acceptances per run.
        - title: Action
          type: object
          required:
            - type
            - action_prohibited
          properties:
            type:
              type: string
              enum:
                - action
            action_prohibited:
              type: string
              enum:
                - delete
                - cancel
                - terms_acceptance
              description: The action to prohibit.
          additionalProperties: false
          description: Never perform `action_prohibited`.
        - title: Custom
          type: object
          required:
            - type
            - rule
          properties:
            type:
              type: string
              enum:
                - custom
            rule:
              type: string
              maxLength: 500
              description: A rule in plain text, up to 500 characters.
          additionalProperties: false
          description: A rule in plain text.
      description: >-
        A [task policy](/concepts/tasks#policies). Each policy has a `type` and
        one field for that type.
    TaskRunBrowserDom:
      type: object
      properties:
        page_url:
          type:
            - 'null'
            - string
          description: URL of the page the snapshot was taken on.
        file_type:
          type: string
          description: Always `text/html`.
        file_size:
          type: integer
          description: Size in bytes.
        truncated:
          type: boolean
          description: '`true` if the page exceeded the size limit and was cut.'
        url:
          type:
            - 'null'
            - string
          description: >-
            Path to download the file, relative to the API base, such as
            `/v2/task-runs/{run_id}/browser-logs/dom`. Call it with your API key
            like any other request.
        created_at:
          type: string
          format: date-time
          example: '2026-09-22T12:00:00Z'
          description: ISO 8601 timestamp of when the snapshot was taken.
      description: The HTML of the last page the run was on.
    TaskRunBrowserHar:
      type: object
      properties:
        file_type:
          type: string
          description: Always `application/json`.
        file_size:
          type: integer
          description: Size in bytes.
        truncated:
          type: boolean
          description: >-
            `true` if some network entries were dropped. Matches
            `logs_truncated`.
        url:
          type:
            - 'null'
            - string
          description: >-
            Path to download the file, relative to the API base, such as
            `/v2/task-runs/{run_id}/browser-logs/har`. Call it with your API key
            like any other request.
        created_at:
          type: string
          format: date-time
          example: '2026-09-22T12:00:00Z'
          description: ISO 8601 timestamp of when the file was generated.
      description: >-
        The run's network requests as a HAR 1.2 file. Opens in Chrome DevTools,
        Charles, and Proxyman.
  securitySchemes:
    BearerAuth:
      type: http
      description: Secret key (sk_live_...)
      scheme: bearer
      bearerFormat: JWT

````

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