# Create a new agent

> You're reading the Mindset v3 documentation. v3 is no longer sold; this is reference for existing customers. Mindset 4 docs are at /docs.

Mindset v3 REST API reference: Agent Management (deprecated).

**POST** `/api/v1/appuid/{appUid}/agents`

## Base URL

Requests go to your region's API host, for example `https://a.api.mindset.ai`. Hosts: `https://a.api.mindset.ai`, `https://b.api.mindset.ai`, `https://c.api.mindset.ai`, `https://d.api.mindset.ai`.

## Authorization

- `x-api-key` (string, required, header)

  Your API key.

## Path parameters

- `appUid` (string, required, path)

  Your application's uid

## Request body

Content type: `application/json`.

- `agentName` (string, required, body)

  Name of the agent

* `agentPurpose` (string, body)

  Purpose of the agent

- `formatting` (string, body)

  Output formatting instructions

* `agentPersonality` (string, body)

  Personality of the agent

- `agentPolicyRules` (string, body)

  Policy rules for the agent

* `iceBreakerMessage` (string, body)

  Invisible instruction to prompt the agent to greet users in a specific way or style

- `live` (boolean, body)

  Agent is active and live for end users

  Default: `false`.

* `contextUids` (string\[], body)

  Array of existing context Uids (max 30)

- `mcpserverUids` (string\[], body)

  Array of existing MCP server Uids (max 5)

* `tags` (string\[], body)

  Array of tags (max 10)

- `access` (string, body)

  Access control mode for this agent. Use Agent Sessions with restrictedAccess agents.

  One of: `openAccess`, `restrictedAccess`. Default: `"restrictedAccess"`.

* `externalTenantId` (string, body)

  External tenant identifier. Valid characters are A-Za-z0-9\_-.

```json
{
  "agentName": "string",
  "agentPurpose": "string",
  "formatting": "string",
  "agentPersonality": "string",
  "agentPolicyRules": "string",
  "iceBreakerMessage": "string",
  "live": true,
  "contextUids": [
    "string"
  ],
  "mcpserverUids": [
    "string"
  ],
  "tags": [
    "string"
  ],
  "access": "openAccess",
  "externalTenantId": "string"
}
```

## Responses

### 201

Agent created successfully

```json
{
  "uid": "string",
  "agentName": "string",
  "agentPurpose": "string",
  "formatting": "string",
  "agentPersonality": "string",
  "agentPolicyRules": "string",
  "iceBreakerMessage": "string",
  "live": true,
  "createdAt": "string",
  "contextUids": [
    "string"
  ],
  "mcpserverUids": [
    "string"
  ],
  "tags": [
    "string"
  ],
  "access": "openAccess",
  "externalTenantId": "string"
}
```

### 400

Bad Request

### 401

Unauthorized

### 403

Forbidden

### 422

Unprocessable Entity

### 500

Internal Server Error

## Example request

```bash
curl -X POST "https://a.api.mindset.ai/api/v1/appuid/{appUid}/agents" \
  -H "x-api-key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"agentName":"string","agentPurpose":"string","formatting":"string","agentPersonality":"string","agentPolicyRules":"string","iceBreakerMessage":"string","live":true,"contextUids":["string"],"mcpserverUids":["string"],"tags":["string"],"access":"openAccess","externalTenantId":"string"}'
```
