Skip to main content
Generated from the SDK route registry and public SDK types by scripts/generate-play-sdk-reference.ts. Do not edit this file manually.
Generated from source comments and type declarations by scripts/generate-play-sdk-reference.ts. Do not edit this file manually.

Version And Coverage

Best Current Pattern

Strong runtime API references lead with base URL, auth, version/contract metadata, language examples, and exact generated route tables. Deepline follows that shape here: use the quick call flows first, then the generated route and type tables below for contract details.

Quick Call Flow

  1. POST /api/v2/plays/run with a saved/prebuilt name and JSON input.
  2. Read workflowId from the response. Treat it as the public run id.
  3. Poll GET /api/v2/runs/:runId or stream GET /api/v2/runs/:runId/tail.
  4. Stop when status is completed, failed, or cancelled.
  5. Read final user output from result or the compact package.outputs object.
Use the CLI or TypeScript SDK for local file compilation and artifact upload. Raw HTTP is best for backend services, Python jobs, schedulers, notebooks, and warehouses that invoke an already-saved or prebuilt play.

Tool And Provider Call Flow

  1. GET /api/v2/tools/search?q=... to discover ranked provider/tool candidates.
  2. GET /api/v2/integrations/:toolId/get to inspect input schema, pricing, extractors, and examples.
  3. POST /api/v2/integrations/:toolId/execute with payload to execute the provider-backed tool.
  4. Read normalized data from toolResponse.raw, extractedValues, and extractedLists. Do not expose provider spend; customer-visible billing is Deepline credits/USD only.
Inside a play, prefer ctx.tools.execute(...) so calls are durable, idempotent, and recorded in run progress. From a regular SDK process, use Deepline.connect().tools.execute(...) or client.executeTool(...).

Authentication

Use the Deepline host plus a workspace API key from a trusted backend environment.
Every request uses bearer auth:

Start A Named Or Prebuilt Play

Response:

Poll Status

Terminal statuses are completed, failed, and cancelled. queued, running, and waiting are non-terminal.

Stream Events

The stream emits a canonical run snapshot first, then incremental play events until the connection closes or the run reaches terminal state.

Stop A Run

Python Caller

This example is copied from docs-examples/sdk-v2/http-python/run_prebuilt.py and compiled by bun run docs:sdk-v2:check. Source: docs-examples/sdk-v2/http-python/run_prebuilt.py

Generated Route Tables

Runtime Health

Tool And Provider Calls

Customer Data

Play Runs

Play Definitions

Play Artifacts

Management And CLI

Recent Compatible API Changes

These entries come from the compatible SDK/API change ledger and explain additive changes that did not require an SDK API-contract bump. Each change lives in src/lib/sdk/compatible-changes/ so concurrent PRs do not edit a shared ledger file.

Public Types

ToolDefinition

Summary definition of a callable provider-backed tool. Returned by DeeplineClient.listTools and ranked tool search. Use getTool(toolId) or the matching HTTP describe route for provider-specific schema, examples, pricing, and extraction guidance before executing.

Fields

ToolSearchOptions

Query options for ranked tool/provider discovery.

Fields

ToolSearchResult

Ranked tool/provider discovery response. Includes matching tools plus render/action hints used by the CLI and agents.

Fields

ToolExecution

Standard provider/tool execution envelope returned by low-level SDK calls. toolResponse.raw contains the provider result. extractedValues and extractedLists contain Deepline-normalized getters when the tool exposes them. Billing fields are Deepline-facing and must not expose provider spend.

Fields

StartPlayRunRequest

Request body for starting a play run via DeeplineClient.startPlayRun. Internal/advanced request shape for low-level submission primitives. Most callers should prefer deepline plays run, DeeplineClient.runPlay, or Deepline.connect. Either name (for live plays) or artifactStorageKey (for packaged ad hoc runs) is required.

Fields

PlayRunStart

Response from starting a play run. Internal/advanced payload returned by low-level play submission primitives. Most callers should prefer deepline plays run, DeeplineClient.runPlay, or PlayJob.get.

Fields

PlayStatus

Current status of a play execution, returned by DeeplineClient.getPlayStatus. Poll this until status reaches a terminal state: 'completed' | 'failed' | 'cancelled'.

Fields

PlayRunPackage

Compact canonical package for an inspected play run. This object is designed for SDK/CLI/API consumers that need stable run metadata, output handles, and follow-up actions without reading dashboard internals.

Fields

PlayRunListItem

Summary of a single play run, returned by DeeplineClient.listPlayRuns.

Fields

StopPlayRunResult

Result returned by DeeplineClient.stopPlay.

Fields

RunsNamespace

Public runs namespace exposed as client.runs. This namespace mirrors the canonical /api/v2/runs resource family and is the preferred low-level surface for polling, streaming, stopping, reading logs, and exporting durable dataset rows.

Fields

CustomerDbQueryResult

Result returned by DeeplineClient.db.query. Rows are intentionally untyped because the schema depends on the caller’s SQL query and selected customer tables.

Fields