curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.computer.stateset.app/api/v1/jobs/{job_id}/clone-to-template' \
--header "X-API-Key: $STATESET_COMPUTER_USE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"name": "Two-Person Tent",
"description": "Two-person tent, green — replacement for damaged pole set.",
"include_instruction": false
}'
{
"name": "Two-Person Tent",
"kind": "builtin",
"description": "Two-person tent, green — replacement for damaged pole set."
}
Clone Job To Template V1
Promote a job’s configuration into a reusable template. Captures params minus the per-call fields (instruction, idempotency key, etc.) into the new template’s…
POST
/
api
/
v1
/
jobs
/
{job_id}
/
clone-to-template
curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.computer.stateset.app/api/v1/jobs/{job_id}/clone-to-template' \
--header "X-API-Key: $STATESET_COMPUTER_USE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"name": "Two-Person Tent",
"description": "Two-person tent, green — replacement for damaged pole set.",
"include_instruction": false
}'
{
"name": "Two-Person Tent",
"kind": "builtin",
"description": "Two-person tent, green — replacement for damaged pole set."
}
Confirm your deployment before running this request. This page describes an API contract;
a published reference does not establish hosted availability. Check the dated
host report and obtain your deployment URL and credentials.
Replace the example host if your provisioned service uses a different URL.
params minus the per-call fields (instruction, idempotency
key, etc.) into the new template’s defaults. Useful workflow:
iterate on a one-off /trigger call until it works, then
clone-to-template to make it the team’s reusable starting point.
Reserved per-call params NOT carried into defaults:
instruction (unless include_instruction=true), tags,
webhook_url, webhook_secret, output_schema. Everything else
(model, effort, max_cost_usd, custom params) is preserved.
Path parameters
string (uuid)
required
Request body
CloneJobToTemplateRequest
string
required
Template name. Same rules as
POST /templates: alphanumeric + underscore + dash, must not collide with a built-in or an existing tenant template. Minimum length: 1. Maximum length: 128.string
required
Human-readable purpose; surfaces in
GET /templates. Minimum length: 1. Maximum length: 256.boolean
When true, the source job’s
instruction is captured as a template default. Most callers want false (the instruction is per-call, the template captures the surrounding config). Default: false.Response
TemplateInfo
string
required
The exact string to pass as
agent_type on /trigger.string
required
builtin ships with the platform; tenant is owned by your org. Allowed values: 'builtin', 'tenant'.string,null
Human-readable description (tenant templates only).
Status codes
| Code | Meaning |
|---|---|
201 | Successful Response |
422 | Validation Error |
Using this contract
Read the source OpenAPI document for declared schemas and alternatives. This page also includes documented corrections from the spec overlays. Example IDs and values are illustrative; replace them with records from your workspace.curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.computer.stateset.app/api/v1/jobs/{job_id}/clone-to-template' \
--header "X-API-Key: $STATESET_COMPUTER_USE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"name": "Two-Person Tent",
"description": "Two-person tent, green — replacement for damaged pole set.",
"include_instruction": false
}'
{
"name": "Two-Person Tent",
"kind": "builtin",
"description": "Two-person tent, green — replacement for damaged pole set."
}
Last modified on September 21, 2026