curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.computer.stateset.app/api/v1/templates/import' \
--header "X-API-Key: $STATESET_COMPUTER_USE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"templates": [
{
"name": "Two-Person Tent",
"description": "Two-person tent, green — replacement for damaged pole set.",
"defaults": {}
}
],
"on_conflict": "skip"
}'
{
"created": 1,
"skipped": 1,
"replaced": 1,
"errored": 1,
"rows": [
{
"name": "Two-Person Tent",
"action": "created",
"error": "string"
}
]
}
Import Templates V1
Bulk template import with explicit conflict policy. on_conflict=error is all-or-nothing: any pre-existing name aborts the whole import before any DB writes…
POST
/
api
/
v1
/
templates
/
import
curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.computer.stateset.app/api/v1/templates/import' \
--header "X-API-Key: $STATESET_COMPUTER_USE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"templates": [
{
"name": "Two-Person Tent",
"description": "Two-person tent, green — replacement for damaged pole set.",
"defaults": {}
}
],
"on_conflict": "skip"
}'
{
"created": 1,
"skipped": 1,
"replaced": 1,
"errored": 1,
"rows": [
{
"name": "Two-Person Tent",
"action": "created",
"error": "string"
}
]
}
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.
on_conflict=error is all-or-nothing: any pre-existing name aborts
the whole import before any DB writes land. The skip and replace
modes apply per-row and report outcomes individually.
Built-in name collisions are rejected per-row regardless of the
conflict policy — you can never shadow a platform built-in.
Request body
ImportTemplatesRequest
CreateTemplateRequest[]
required
List of templates to import (1..50). Each entry follows the
POST /templates schema. Minimum items: 1. Maximum items: 50.Show CreateTemplateRequest
Show 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.string
What to do when a template name already exists for the tenant:
skip keeps the existing row and reports it in the response; replace overwrites description+defaults; error rejects the whole import (no partial writes). Allowed values: 'skip', 'replace', 'error'. Default: 'skip'.Response
ImportTemplatesResponse
integer
required
integer
required
integer
required
integer
required
ImportTemplateRow[]
required
Status codes
| Code | Meaning |
|---|---|
200 | 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/import' \
--header "X-API-Key: $STATESET_COMPUTER_USE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"templates": [
{
"name": "Two-Person Tent",
"description": "Two-person tent, green — replacement for damaged pole set.",
"defaults": {}
}
],
"on_conflict": "skip"
}'
{
"created": 1,
"skipped": 1,
"replaced": 1,
"errored": 1,
"rows": [
{
"name": "Two-Person Tent",
"action": "created",
"error": "string"
}
]
}
Last modified on September 21, 2026