---
docId: doc_df02893e348244d0ad1800730c74511d
title: Create an agent
description: "Create an agent with a name and instructions, then assign channels to receive their messages."
api:
  group: agentes
  auth: bearer
  operations:
    - operationId: createAgent
      method: POST
      path: '/v1/agents'
      postmanName: Create an agent
---

<script>
  import { Ways } from '$lib/components';
</script>

# Create an agent

Create an agent by sending `name` and any settings you want to change from the [default configuration](/api-reference/agents/configuration#default-configuration). It is published as `v1`, which is also its initial draft.

To receive messages from a channel, assign that channel with [Update a channel](/api-reference/channels/update). Human assistance is off when you create it.

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl https://api.platic.ai/v1/agents \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Sales", "instructions": "Answer in under 80 words." }'
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.agents.create({ name: "Sales", instructions: "Answer in under 80 words." });
```

</Ways.Way>
</Ways>

## Request body

| Field | Type | Description | Required |
|-------|------|-------------|----------|
| `name` | string | Agent name, 1 to 100 characters | ✓ |
| `imageUrl` | string | URL or path of the agent's photo, up to 2048 characters. Without it, Platica assigns one | - |
| `description`, `instructions`, `model`, `modelPriority`, `fallbackModels`, `memory`, `fileAttachments`, `scheduledTasks`, `multilingual`, `workingMessage`, `subagents`, `assistance`, `schedule`, `guardrails`, `followUp` | depends on the section | The [configuration](/api-reference/agents/configuration#sections) sections you want to define, directly in the body. They are applied over the default configuration. See [partial changes](/api-reference/agents/configuration#partial-changes) | - |
| `note` | string | Note for version `v1`, up to 500 characters | - |

`name` is required; `instructions` is a string. The name and photo go in `name` and `imageUrl`. You can later change them with [Update an agent](/api-reference/agents/update); they are not part of the versions.

```json
{
  "name": "Sales",
  "instructions": "You are the sales assistant for Acme Store.",
  "guardrails": { "message": "I can only help with store topics." },
  "note": "First version"
}
```

## Response

`201 Created` with the agent:

```json
{
  "status": "success",
  "data": {
    "id": "Xq8mTe2LwP4kZ1aB9cDf",
    "name": "Sales",
    "imageUrl": "/images/agents/avatars/p46.jpg",
    "status": "active",
    "owners": [],
    "draft": { "versionId": "v1", "number": 1 },
    "publication": { "versionId": "v1", "number": 1 },
    "hasUnpublishedChanges": false,
    "createdAt": "2026-10-28T12:00:00.000Z"
  }
}
```

See each response field in [Get an agent](/api-reference/agents/get#response-fields).

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `400` | `INVALID_REQUEST` | The body doesn't have the expected shape, for example `name` is missing |
| `422` | `INVALID_CONFIG` | The resulting configuration isn't valid, for example it includes a name from the [earlier shape](/api-reference/agents/configuration#if-you-used-the-earlier-shape) such as `runtime`, or `model` isn't a [model Platica knows](/api-reference/agents/configuration#reasoning-level). `details.issues` lists the field path for each problem. Nothing is created |
| `422` | `INVALID_SUBAGENT_LINK` | `subagents` links an agent that doesn't exist in the workspace |
| `422` | `UNSUPPORTED_REASONING_EFFORT` | `model` or a model in `fallbackModels` asks for a [reasoning level](/api-reference/agents/configuration#reasoning-level) it doesn't accept. `details.supportedEfforts` lists the supported values. Nothing is created |
| `422` | `MODEL_FALLBACKS_REQUIRE_OWN_KEY` | `fallbackModels` includes fallback models, but the workspace has no connected provider key of its own. Nothing is created. See [fallback models](/api-reference/agents/configuration#fallback-models) |
| `422` | `INVALID_ESCALATION` | An escalation in `assistance.escalations` doesn't exist in the workspace or is archived. `details.escalations` lists each one with `escalationId` and `reason`: `not_found` or `archived`. Nothing is created |
| `503` | `SUPPORT_SERVICE_UNAVAILABLE` | The escalations in `assistance.escalations` couldn't be checked. Nothing is created; try again |

The format of `details.issues` is in [Validation](/api-reference/agents/configuration#validation).

## Notes

- To enable human assistance, send `assistance` with `enabled: true` and the `escalations` it can use: see [Leave an agent escalating](/api-reference/escalations#set-up-an-agent-to-escalate-step-by-step). The wait message goes in each escalation that pauses the agent (`agent.waitMessage`).
- If you create it with an OAuth token, the person who owns the token becomes the agent's owner. With an API key, it has no owners.
- To keep editing it, [edit the draft](/api-reference/agents/drafts/update) and [publish](/api-reference/agents/publications/publish) the new version.
