> ## 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 Custom Agent V1

> Create a custom agent. Configurations stick until deleted. Use PATCH to flip is_active rather than re-creating to preserve audit history.

Create a custom agent.

Configurations stick until deleted. Use `PATCH` to flip `is_active`
rather than re-creating to preserve audit history.

### Request body

`CustomAgentRequest`

<ParamField body="name" type="string" required>
  Human-readable agent name (≤128 chars).
</ParamField>

<ParamField body="description" type="string,null">
  Free-form description (≤4 KB). Surfaces in the dashboard list view.
</ParamField>

<ParamField body="system_prompt_extension" type="string,null">
  Text appended to the platform's default system prompt for this agent's runs (≤16 KB). Use to give the agent persistent persona or domain-specific instructions.
</ParamField>

<ParamField body="agent_type" type="string">
  Tag for this agent's runs; default 'custom'. Free-form.
</ParamField>

<ParamField body="skills" type="string[]">
  Skill IDs or names to register on each run (≤100 entries).
</ParamField>

<ParamField body="tool_permissions" type="string[]">
  Allow-list of tool names this agent may use; empty = full default tool set. Useful for sandboxing untrusted prompts.
</ParamField>

<ParamField body="default_params" type="object">
  Params merged into every `/trigger` call invoking this agent.
</ParamField>

<ParamField body="trigger_config" type="object">
  Optional trigger metadata — e.g. `&#123;type: 'scheduled', cron: '0 9 * * *'&#125;`. Free-form; the worker reads documented keys.
</ParamField>

### Response

`CustomAgentSummary`

<ResponseField name="id" type="string" required />

<ResponseField name="name" type="string" required />

<ResponseField name="description" type="string,null" required />

<ResponseField name="system_prompt_extension" type="string,null" required />

<ResponseField name="agent_type" type="string" required />

<ResponseField name="skills" type="string[]" required />

<ResponseField name="tool_permissions" type="string[]" required />

<ResponseField name="default_params" type="object" required />

<ResponseField name="trigger_config" type="object" required />

<ResponseField name="is_active" type="boolean" required />

<ResponseField name="is_sandbox" type="boolean" required />

<ResponseField name="created_at" type="string" required />

<ResponseField name="updated_at" type="string" required />

### 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/custom-agents' \
    --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.",
    "system_prompt_extension": "string",
    "agent_type": "custom",
    "skills": [
      "string"
    ],
    "tool_permissions": [
      "string"
    ],
    "default_params": {},
    "trigger_config": {}
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "Two-Person Tent",
    "description": "Two-person tent, green — replacement for damaged pole set.",
    "system_prompt_extension": "string",
    "agent_type": "string",
    "skills": [
      "string"
    ],
    "tool_permissions": [
      "string"
    ],
    "default_params": {},
    "trigger_config": {},
    "is_active": true,
    "is_sandbox": true,
    "created_at": "2026-08-31T14:22:05Z",
    "updated_at": "2026-08-31T14:22:05Z"
  }
  ```
</ResponseExample>
