Skip to main content
GET
Read one published workflow version
Requires agents:read. Returns one published version of the agent together with the workflow document it ran. Use it to look at an older version before you restore it.
string
required
Local agent UUID.
string
required
The version’s id, from data[].id of List workflow versions.
The answer has everything a row of the list has (id, version, draft_version, content_hash, compiler_version, environment, published_at, source, source_run_id, restored_from_version) plus: An id that is not a UUID, an id that names nothing, and the id of another agent’s version all answer 404 WORKFLOW_NOT_FOUND. The route takes no query parameters: one is refused with 400 WORKFLOW_REQUEST_INVALID. Reading a version changes nothing. To make it live again, see Restore workflow version.

Authorizations

Authorization
string
header
required

Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).

Headers

x-company-id
string<uuid>

Explicit active workspace. Optional; when sent it must be the API key's own workspace — any other value is refused with 403 WORKSPACE_MISMATCH.

Path Parameters

id
string<uuid>
required
version_id
string<uuid>
required

A version's id, from data[].id of GET /agents/{id}/workflow/versions.

Response

The version and its document.

id
string<uuid>
required
version
integer
required
Required range: x >= 1
content_hash
string
required
Pattern: ^[a-f0-9]{64}$
published_at
string<date-time>
required
document
WorkflowDefinition · object
required
is_current
boolean
required

True when callers reach this version now.

environment
enum<string>
read-only

The deployment plane that compiled and stored this revision. Decided by the deployment, never sent by the caller; the hosted API stores as testing. A call loads only a version stored on the plane it runs on, and publishing and calling through the same API are the same plane. See the List workflow versions page.

Available options:
local,
testing,
production
source
enum<string> | null

How the version came to be. teach - published by Teach from a test call; restore - published by a restore (including an undo of a Teach run); null - published by a person from the editor or the API.

Available options:
teach,
restore,
null
source_run_id
string<uuid> | null

The Teach run that published this version. Null unless source is teach.

restored_from_version
integer | null

The version number this one is a copy of. Null unless source is restore.

Required range: x >= 1
draft_version
integer
Required range: x >= 1
compiler_version
string