Template drafts

Open a test instance of a template version, published or not

Opens a layered session workspace (purpose template_test) on that version of the organization’s template: registered and not archived, published or not. It is a fresh workspace (a create startup run) with origin {kind: template_version, template_id, version}; it ends on close() or idle. inputs as for open (422 input_unknown, input_invalid, input_required). 202 OpenResponse (200 when an existing key is running and ready). Errors: 403 template_dev_mode_role (owners, admins and API keys with a tool permission only), 404 version_not_found, 409 template_not_layered, template_archived, 422 reserved_key_prefix; 402/403/429 as for open (admitted like a start: a concurrent_workspaces refusal is queued up to 10 s, then 429 quota_exceeded with Retry-After). tool_token is null when the tool-token rate limit is used up. Supports Idempotency-Key.

post/v1/templates/{slug}/versions/{version}/test-instances

Request

  • Base URL: https://api.shardflux.dev
  • URL: https://api.shardflux.dev/v1/templates/{slug}/versions/{version}/test-instances
  • Auth: HTTP bearer

Path parameters

slugstring required
versioninteger required

Request body

keystring

Workspace key (default sf:test:<slug>:<8 hex>); caller keys starting with sf: are reserved.

agent_labelstring
toolsstring[]
inputsobject

Open-time inputs of the template version: {NAME: string} for its declared text inputs. A new workspace stores each given value, else the declared default; on an existing key inputs replaces them all (omitted = unchanged). Secret inputs are not passed here: they bind the stored secret of the same name. 422 input_unknown (undeclared name, details.names), input_invalid (a secret input, a non-string, or a value over 4096 bytes or with CR, LF or NUL; details.names), input_required (details {names, kind}).

project_idstring uuid

UUIDv7, lowercase canonical form.

Response

202: poll operation; 200: an existing instance that is running and ready (tool_token set).

cell_endpointstring nullable required

Changes

No recorded changes to this operation across all 1 revision of this API.