> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.

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.

### Request body

`CreateTemplateRequest`

<ParamField body="name" type="string" required>
  Template identifier — passed as `agent_type` on `/trigger`. Alphanumeric + underscore + dash; must not collide with a platform built-in name.
</ParamField>

<ParamField body="description" type="string" required>
  Human-readable purpose; surfaces in `GET /templates`.
</ParamField>

<ParamField body="defaults" type="object">
  Default `params` merged into every trigger that targets this template. The tenant's request payload overrides on key collision.
</ParamField>

### Response

`TemplateInfo`

<ResponseField name="name" type="string" required>
  The exact string to pass as `agent_type` on /trigger.
</ResponseField>

<ResponseField name="kind" type="string" required>
  `builtin` ships with the platform; `tenant` is owned by your org.
</ResponseField>

<ResponseField name="description" type="string,null">
  Human-readable description (tenant templates only).
</ResponseField>

### Status codes

| Code  | Meaning             |
| ----- | ------------------- |
| `201` | Successful Response |
| `422` | Validation Error    |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.computer.stateset.app/api/v1/templates' \
    --header 'X-API-Key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "name": "Two-Person Tent",
    "description": "Two-person tent, green — replacement for damaged pole set.",
    "defaults": {}
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "name": "Two-Person Tent",
    "kind": "builtin",
    "description": "Two-person tent, green — replacement for damaged pole set."
  }
  ```
</ResponseExample>
