curl --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 --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"
}
]
}
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 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.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).Response
ImportTemplatesResponse
integer
required
integer
required
integer
required
integer
required
Status codes
| Code | Meaning |
|---|---|
200 | Successful Response |
422 | Validation Error |
curl --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 August 31, 2026