curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.computer.stateset.app/api/v1/templates' \
--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.",
"defaults": {}
}'
{
"name": "Two-Person Tent",
"kind": "builtin",
"description": "Two-person tent, green — replacement for damaged pole set."
}
Create Template V1
Create a tenant-owned template. Returns 422 if the name collides with a platform built-in, 409 if a template with the same name already exists for the tenant.
POST
/
api
/
v1
/
templates
curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.computer.stateset.app/api/v1/templates' \
--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.",
"defaults": {}
}'
{
"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.
Request body
CreateTemplateRequest
string
required
Template identifier — passed as
agent_type on /trigger. Alphanumeric + underscore + dash; must not collide with a platform built-in name. Minimum length: 1. Maximum length: 128.string
required
Human-readable purpose; surfaces in
GET /templates. Minimum length: 1. Maximum length: 256.object
Default
params merged into every trigger that targets this template. The tenant’s request payload overrides on key collision.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/templates' \
--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.",
"defaults": {}
}'
{
"name": "Two-Person Tent",
"kind": "builtin",
"description": "Two-person tent, green — replacement for damaged pole set."
}
Last modified on September 21, 2026