---
title: "Create agent"
method: POST
path: "/api/agents"
tags: ["Platform API"]
---

# Create agent

`POST /api/agents`

Create an Outlit agent. Use type=template for supported templates or type=custom for a custom hosted agent.

## Request body

- union
  - CreateAgentTemplateRequest
    - `type` 'template', required
    - `templateKey` 'churn', required
    - `mode` 'draft'
  - CreateAgentCustomRequest
    - `type` 'custom', required
    - `displayName` string, required
    - `instructions` string, required
    - `maxItemsToSurface` integer
    - `actionKeys` string[]

## Response `200`

Agent was created.

- CreateAgentCommandSuccess
  - `ok` true, required
  - `commandId` 'agent.create', required
  - `commandVersion` 1, required
  - `correlationId` string, required
  - `result` object, required
    - `operationId` 'agent.create', required
    - `status` 'completed', required
    - `resources` CommandResource[], required
      - `type` string, required
      - `id` string, required
    - `data` object, required
      - `agent` AgentSummary, required
        - `id` string, required
        - `agentKey` string, required
        - `displayName` string, required
        - `status` 'ENABLED' | 'DISABLED', required
        - `templateVersion` string, required
        - `actionKeys` string[], required
        - `schedule` AgentScheduleSummary, required
          - `enabled` boolean, required
          - `nextRunAt` string, date-time, nullable, required
          - `lastRunAt` string, date-time, nullable, required
          - `lastSuccessfulRunAt` string, date-time, nullable, required
        - `createdAt` string, date-time, required
        - `updatedAt` string, date-time, required
    - `warnings` string[], required
    - `auditId` string

## Other responses

- `400` — Invalid JSON or unsupported agent create request.
- `401` — Invalid or missing API key.
- `403` — The API key is valid but does not have the required agent write scope.
- `409` — The requested template or agent conflicts with the current platform state.
- `500` — Internal server error.
- `503` — The platform could not complete the command.

## Changes

- **2026-07-01** `69ab63e7045c` — 2 warning, 1 info
  - removed the request property `oneOf[#/components/schemas/CreateAgentCustomRequest]/skipCriteria`
  - removed the request property `oneOf[#/components/schemas/CreateAgentCustomRequest]/surfaceCriteria`
  - the `oneOf[#/components/schemas/CreateAgentCustomRequest]/instructions` request property's maxLength was increased from `10000` to `32000`
- **2026-06-29** `012f9a36abf9` — 9 breaking, 2 warning, 3 info
  - the request's body type/format changed from `object`/`` to ``/``
  - the `commandId` response property const value changed from `agent.createFromTemplate` to `agent.create` for the status `200`
  - the `operationId` response property const value changed from `agent.template.create` to `agent.create` for the status `200`
  - removed the required property `result/allOf[subschema #2]/data/agentId` from the response with the `200` status
  - …10 more
- **2026-06-29** `7e4ecacaa07f` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/outlitai/apis/outlit-api/changes/api/agents/post.md)

---

[API](https://skmtc.dev/outlitai/apis/outlit-api.md) · [All operations](https://skmtc.dev/outlitai/apis/outlit-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/outlitai/outlit-api/revisions/147173adbb3f/schema)
