# Assistants API

> An assistant's identity: name, personality, writing style, email address and phone lines. A user can have several assistants, one of them primary.

Part of the AGNT API reference. AGNT (https://agnt.ai) is the developer platform behind OpenAssistant (https://openassistant.us). Docs index: https://agnt.ai/llms.txt. Web page: https://agnt.ai/reference/api/assistants

Base URL: `https://api.agnt.ai`. Auth: `Authorization: Bearer ak_live_...`.

## GET /assistants

List assistants

Returns the assistants the caller can see, sorted by scope and name. Pass `email` to look one up by its address.

**Query parameters**

- `email` (string)

**Responses**

- `200`: Assistants list
  - `ok` (enum, required) One of: `true`.
  - `assistants` (object[], required)
    - `id` (string, required)
    - `account` (string, required)
    - `organization` (string | null, required)
    - `team` (string | null, required)
    - `user` (string | null, required)
    - `scope` (enum, required) One of: `account`, `organization`, `team`, `user`.
    - `name` (string, required)
    - `email` (string, required)
    - `avatarUrl` (string | null, required)
    - `signature` (string | null, required)
    - `signatureEditorMode` (enum) One of: `visual`, `html`.
    - `personality` (string)
    - `tagline` (string | null)
    - `backstory` (string | null)
    - `role` (string | null)
    - `displayPersonality` (string | null)
    - `gender` (enum) One of: `male`, `female`, `other`, `null`.
    - `pronouns` (string | null)
    - `country` (string | null)
    - `signaturePhrases` (string[])
    - `writingStyle` (object, required)
      - `professionalism` (number)
      - `humor` (number)
      - `emojiUse` (number)
      - `characterInspiration` (string)
      - `externalCommunication` (string)
      - `oneOnOneCommunication` (string)
    - `voice` (object | null, required)
      - `voiceId` (string | null)
      - `provider` (string)
    - `status` (enum, required) One of: `active`, `inactive`.
    - `talkToStrangers` (boolean, required)
    - `metadata` (object)
    - `inboxPlatform` (enum, required) One of: `google`, `outlook`, `null`.
    - `inboxAuthError` (boolean)
    - `channels` (object)
      - `imessage` (string | null)
      - `sms` (string | null)
      - `whatsapp` (string | null)
      - `voice` (object)
        - `status` (enum) One of: `none`, `provisioning`, `pending_a2p`, `active`, `failed`.
        - `provisionedAt` (string | null)
        - `recordingDisclosure` (boolean)
    - `appearanceDescription` (string)
    - `tags` (object)
    - `deletedAt` (string | null)
    - `retiredEmail` (string | null)
    - `emailReleasedAt` (string | null)
    - `createdAt` (string, required)
    - `updatedAt` (string, required)
  - `page` (integer)
  - `perPage` (integer)
  - `total` (integer)

```bash
curl 'https://api.agnt.ai/assistants' \
  -H "Authorization: Bearer ak_live_..."
```

Example response:

```json
{
  "ok": true,
  "assistants": [
    {
      "id": "6702b4c1d2e3f4a5b6c7d8e9",
      "account": "66f1a2b3c4d5e6f708192a3b",
      "scope": "user",
      "user": "6702b1e8f9a0b1c2d3e4f5a6",
      "name": "Ava",
      "email": "ava@assistants.harborview.co",
      "status": "active",
      "talkToStrangers": false,
      "createdAt": "2026-10-01T15:04:05Z"
    }
  ]
}
```

## POST /assistants

Create an assistant

Creates an assistant. `scope` sets who can use it: `account` (every user of your app), `organization`, `team` or `user`. The email address must be free in your account.

**Request body** (JSON)

- `name` (string, required)
- `email` (string, required)
- `scope` (enum) One of: `account`, `organization`, `team`, `user`.
- `organization` (string | null)
- `team` (string | null)
- `personality` (string)
- `signature` (string | null)
- `signatureEditorMode` (enum) One of: `visual`, `html`.
- `writingStyle` (object)
  - `professionalism` (number)
  - `humor` (number)
  - `emojiUse` (number)
  - `characterInspiration` (string)
  - `externalCommunication` (string)
  - `oneOnOneCommunication` (string)
- `avatar` (string | null)
- `appearanceDescription` (string)
- `tagline` (string | null)
- `backstory` (string | null)
- `displayPersonality` (string | null)
- `gender` (enum) One of: `male`, `female`, `other`, `null`.
- `pronouns` (string | null)
- `country` (string | null)
- `metadata` (object)
- `talkToStrangers` (boolean)
- `voice` (object | null)
  - `voiceId` (string | null)
  - `provider` (string)

**Responses**

- `201`: Created assistant
  - `ok` (enum, required) One of: `true`.
  - `assistant` (object, required)
    - `id` (string, required)
    - `account` (string, required)
    - `organization` (string | null, required)
    - `team` (string | null, required)
    - `user` (string | null, required)
    - `scope` (enum, required) One of: `account`, `organization`, `team`, `user`.
    - `name` (string, required)
    - `email` (string, required)
    - `avatarUrl` (string | null, required)
    - `signature` (string | null, required)
    - `signatureEditorMode` (enum) One of: `visual`, `html`.
    - `personality` (string)
    - `tagline` (string | null)
    - `backstory` (string | null)
    - `role` (string | null)
    - `displayPersonality` (string | null)
    - `gender` (enum) One of: `male`, `female`, `other`, `null`.
    - `pronouns` (string | null)
    - `country` (string | null)
    - `signaturePhrases` (string[])
    - `writingStyle` (object, required)
      - `professionalism` (number)
      - `humor` (number)
      - `emojiUse` (number)
      - `characterInspiration` (string)
      - `externalCommunication` (string)
      - `oneOnOneCommunication` (string)
    - `voice` (object | null, required)
      - `voiceId` (string | null)
      - `provider` (string)
    - `status` (enum, required) One of: `active`, `inactive`.
    - `talkToStrangers` (boolean, required)
    - `metadata` (object)
    - `inboxPlatform` (enum, required) One of: `google`, `outlook`, `null`.
    - `inboxAuthError` (boolean)
    - `channels` (object)
      - `imessage` (string | null)
      - `sms` (string | null)
      - `whatsapp` (string | null)
      - `voice` (object)
        - `status` (enum) One of: `none`, `provisioning`, `pending_a2p`, `active`, `failed`.
        - `provisionedAt` (string | null)
        - `recordingDisclosure` (boolean)
    - `appearanceDescription` (string)
    - `tags` (object)
    - `deletedAt` (string | null)
    - `retiredEmail` (string | null)
    - `emailReleasedAt` (string | null)
    - `createdAt` (string, required)
    - `updatedAt` (string, required)
- `400`: Bad request
  - `status` (integer, required)
  - `error_code` (string)
  - `error` (string, required)

```bash
curl 'https://api.agnt.ai/assistants' \
  -X POST \
  -H "Authorization: Bearer ak_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Ava",
  "email": "user@example.com"
}'
```

Example response:

```json
{
  "ok": true,
  "assistant": {
    "id": "6702b4c1d2e3f4a5b6c7d8e9",
    "account": "66f1a2b3c4d5e6f708192a3b",
    "scope": "user",
    "user": "6702b1e8f9a0b1c2d3e4f5a6",
    "name": "Ava",
    "email": "ava@assistants.harborview.co",
    "status": "active",
    "talkToStrangers": false,
    "createdAt": "2026-10-01T15:04:05Z"
  }
}
```

## GET /assistants/{assistantId}

Retrieve an assistant

Retrieves an assistant's profile, email address, phone lines (`channels`), voice and scope.

**Path parameters**

- `assistantId` (string, required)

**Responses**

- `200`: Assistant
  - Same fields as the `201` response of `POST /assistants`.
- `404`: Not found
  - `status` (integer, required)
  - `error_code` (string)
  - `error` (string, required)

```bash
curl 'https://api.agnt.ai/assistants/<assistantId>' \
  -H "Authorization: Bearer ak_live_..."
```

Example response:

```json
{
  "ok": true,
  "assistant": {
    "id": "6702b4c1d2e3f4a5b6c7d8e9",
    "account": "66f1a2b3c4d5e6f708192a3b",
    "scope": "user",
    "user": "6702b1e8f9a0b1c2d3e4f5a6",
    "name": "Ava",
    "email": "ava@assistants.harborview.co",
    "status": "active",
    "talkToStrangers": false,
    "createdAt": "2026-10-01T15:04:05Z"
  }
}
```

## PUT /assistants/{assistantId}

Update an assistant

Updates an assistant. Only the fields you send change. To add a phone line, create a phone line request.

**Path parameters**

- `assistantId` (string, required)

**Request body** (JSON)

- `name` (string): Display name
- `email` (string): Mailbox address; must be free in your account
- `personality` (string): How the assistant behaves and sounds
- `backstory` (string | null)
- `tagline` (string | null): One-line description shown with the assistant
- `writingStyle` (object): Tone sliders, 0 to 3
  - `professionalism` (number)
  - `humor` (number)
  - `emojiUse` (number)
- `signature` (string | null): Email signature
- `signatureEditorMode` (enum) One of: `visual`, `html`.
- `avatar` (string | null): Image URL or data URI
- `appearanceDescription` (string): What the assistant looks like, used for generated images
- `gender` (enum) One of: `male`, `female`, `other`, `null`.
- `pronouns` (string | null)
- `country` (string | null): Two-letter country code
- `voice` (object | null): Voice engine and voice; see GET /voice/providers. null clears.
  - `provider` (string): Engine id from GET /voice/providers
  - `voiceId` (string | null)
- `talkToStrangers` (boolean): Whether the assistant replies to people who are not users of your app
- `status` (enum) One of: `active`, `inactive`.
- `metadata` (object): Your own key-value data

**Responses**

- `200`: Updated assistant
  - Same fields as the `201` response of `POST /assistants`.

```bash
curl 'https://api.agnt.ai/assistants/<assistantId>' \
  -X PUT \
  -H "Authorization: Bearer ak_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "personality": "Warm, brief and direct. Writes like a seasoned property manager.",
  "writingStyle": {
    "professionalism": 2,
    "humor": 1,
    "emojiUse": 0
  }
}'
```

Example response:

```json
{
  "ok": true,
  "assistant": {
    "id": "6702b4c1d2e3f4a5b6c7d8e9",
    "account": "66f1a2b3c4d5e6f708192a3b",
    "scope": "user",
    "user": "6702b1e8f9a0b1c2d3e4f5a6",
    "name": "Ava",
    "email": "ava@assistants.harborview.co",
    "status": "active",
    "talkToStrangers": false,
    "createdAt": "2026-10-01T15:04:05Z"
  }
}
```

## DELETE /assistants/{assistantId}

Delete an assistant

Deletes an assistant and disconnects its mailboxes.

**Path parameters**

- `assistantId` (string, required)

**Responses**

- `200`: Deleted
  - `ok` (enum, required) One of: `true`.
  - `assistant` (object, required)
    - `id` (string, required)
    - `deleted` (boolean)
    - `message` (string)

```bash
curl 'https://api.agnt.ai/assistants/<assistantId>' \
  -X DELETE \
  -H "Authorization: Bearer ak_live_..."
```

Example response:

```json
{
  "ok": true,
  "assistant": {
    "id": "6660c4a1f2e3b7d8a9c01234"
  }
}
```

## GET /users/{userId}/assistants

List a user's assistants

Returns every assistant on the user's roster, each marked `isPrimary`, plus `primaryAssistantId`.

**Path parameters**

- `userId` (string, required)

**Responses**

- `200`: Roster
  - `ok` (enum, required) One of: `true`.
  - `assistants` (any[], required)
  - `primaryAssistantId` (string | null, required)

```bash
curl 'https://api.agnt.ai/users/<userId>/assistants' \
  -H "Authorization: Bearer ak_live_..."
```

Example response:

```json
{
  "ok": true,
  "assistants": [
    {
      "id": "6702b4c1d2e3f4a5b6c7d8e9",
      "account": "66f1a2b3c4d5e6f708192a3b",
      "scope": "user",
      "user": "6702b1e8f9a0b1c2d3e4f5a6",
      "name": "Ava",
      "email": "ava@assistants.harborview.co",
      "status": "active",
      "talkToStrangers": false,
      "createdAt": "2026-10-01T15:04:05Z",
      "isPrimary": true
    }
  ],
  "primaryAssistantId": "6660c4a1f2e3b7d8a9c01234"
}
```

## POST /users/{userId}/assistants

Create an assistant for a user

Creates an assistant that belongs to the user and adds it to their roster. On an empty roster it becomes the primary. A second call with the same `name` returns the existing assistant with `200`.

**Path parameters**

- `userId` (string, required)

**Request body** (JSON)

- `name` (string, required)
- `email` (string)
- `avatar` (string)
- `signature` (string | null)
- `signatureEditorMode` (enum) One of: `visual`, `html`.
- `personality` (string)
- `backstory` (string | null)
- `gender` (enum) One of: `male`, `female`, `other`, `null`.
- `pronouns` (string | null)
- `country` (string | null)
- `writingStyle` (object)
  - `professionalism` (number)
  - `humor` (number)
  - `emojiUse` (number)
  - `characterInspiration` (string)
  - `externalCommunication` (string)
  - `oneOnOneCommunication` (string)
- `metadata` (object)
- `voice` (object | null)
  - `voiceId` (string | null)
  - `provider` (string)

**Responses**

- `200`: Already existed (idempotent); returned unchanged
  - Same fields as the `201` response of `POST /assistants`.
- `201`: Created and hired
  - Same fields as the `201` response of `POST /assistants`.

```bash
curl 'https://api.agnt.ai/users/<userId>/assistants' \
  -X POST \
  -H "Authorization: Bearer ak_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Ava"
}'
```

Example response:

```json
{
  "ok": true,
  "assistant": {
    "id": "6702b4c1d2e3f4a5b6c7d8e9",
    "account": "66f1a2b3c4d5e6f708192a3b",
    "scope": "user",
    "user": "6702b1e8f9a0b1c2d3e4f5a6",
    "name": "Ava",
    "email": "ava@assistants.harborview.co",
    "status": "active",
    "talkToStrangers": false,
    "createdAt": "2026-10-01T15:04:05Z"
  }
}
```

## POST /users/{userId}/assistants/{assistantId}/hire

Add an assistant to a user

Adds an assistant the user can see to their roster. On an empty roster it also becomes the primary. Returns the updated user.

**Path parameters**

- `userId` (string, required)
- `assistantId` (string, required)

**Responses**

- `200`: Updated user
  - `ok` (enum, required) One of: `true`.
  - `user` (object)
    - `id` (string, required)
    - `account` (string, required)
    - `email` (string)
    - `externalId` (string)
    - `assistant` (string | null, required)
    - `name` (string | null, required)
    - `firstName` (string)
    - `lastName` (string)
    - `avatarUrl` (string | null, required)
    - `timezone` (string, required)
    - `locale` (string, required)
    - `country` (string | null)
    - `city` (string)
    - `organization` (string | null, required)
    - `organizationRole` (enum, required) One of: `admin`, `member`, `guest`.
    - `team` (object | null, required)
      - `id` (string, required)
      - `name` (string, required)
      - `organization` (string | null, required)
      - `status` (string, required)
    - `teamRole` (enum, required) One of: `member`, `admin`, `owner`, `null`.
    - `status` (enum, required) One of: `active`, `inactive`, `suspended`.
    - `voice` (object | null)
      - `voiceId` (string, required)
      - `provider` (string, required)
    - `metadata` (object)
    - `firstLoginAt` (string)
    - `username` (string | null)
    - `preferences` (object)
      - `reminders` (object)
        - `level` (enum): Which calendar events get reminders: all-events (every event), agnt-events (only events the assistant created), or none. One of: `all-events`, `agnt-events`, `none`.
        - `smartReminders` (boolean)
        - `recipient` (object)
          - `asOrganizer` (enum) One of: `only-me`, `with-attendees`, `none`.
          - `asAttendee` (enum) One of: `only-me`, `none`.
        - `calendars` (object)
          - `read` (string[])
        - `email` (object)
          - `enabled` (boolean)
          - `virtualDuration` (number)
          - `inPersonDuration` (number)
        - `slack` (object)
          - `enabled` (boolean)
          - `virtualDuration` (number)
          - `inPersonDuration` (number)
        - `teams` (object)
          - `enabled` (boolean)
          - `virtualDuration` (number)
          - `inPersonDuration` (number)
        - `desktop` (object)
          - `enabled` (boolean)
          - `virtualDuration` (number)
          - `inPersonDuration` (number)
        - `checkInAfter` (number)
      - `preferredProviders` (object)
      - `preferredContactChannel` (object)
    - `assistantName` (string | null)
    - `appName` (string | null)
    - `createdAt` (string, required)
    - `updatedAt` (string, required)
- `403`: Assistant not visible to this user
  - `status` (integer, required)
  - `error_code` (string)
  - `error` (string, required)

```bash
curl 'https://api.agnt.ai/users/<userId>/assistants/<assistantId>/hire' \
  -X POST \
  -H "Authorization: Bearer ak_live_..."
```

Example response:

```json
{
  "ok": true
}
```

## POST /users/{userId}/assistants/{assistantId}/primary

Set a user's primary assistant

Makes an assistant on the user's roster their primary, the one that answers by default. Returns the updated user.

**Path parameters**

- `userId` (string, required)
- `assistantId` (string, required)

**Responses**

- `200`: Updated user
  - Same fields as the `200` response of `POST /users/{userId}/assistants/{assistantId}/hire`.
- `400`: Assistant not on roster
  - `status` (integer, required)
  - `error_code` (string)
  - `error` (string, required)

```bash
curl 'https://api.agnt.ai/users/<userId>/assistants/<assistantId>/primary' \
  -X POST \
  -H "Authorization: Bearer ak_live_..."
```

Example response:

```json
{
  "ok": true
}
```

## DELETE /users/{userId}/assistants/{assistantId}

Remove an assistant from a user

Releases and deletes one of the user's personal assistants. To release an assistant that still has open tasks, pass `transfer=primary` to move that work to the primary assistant.

**Path parameters**

- `userId` (string, required)
- `assistantId` (string, required)

**Query parameters**

- `transfer` (enum) One of: `primary`.

**Responses**

- `200`: Released; returns the updated user
  - Same fields as the `200` response of `POST /users/{userId}/assistants/{assistantId}/hire`.
- `403`: A shared or account-wide assistant, or one the caller may not release
  - `status` (integer)
  - `error_code` (string)
  - `error` (string)
- `409`: Refused: the assistant is the primary, or has pending work
  - `status` (integer, required)
  - `error_code` (string)
  - `error` (string, required)

```bash
curl 'https://api.agnt.ai/users/<userId>/assistants/<assistantId>' \
  -X DELETE \
  -H "Authorization: Bearer ak_live_..."
```

Example response:

```json
{
  "ok": true
}
```

## GET /users/{userId}/assistant

Retrieve a user's personal assistant

Retrieves the assistant created for this user, not a shared one. With `X-User-Email`, `userId` must be the caller.

**Path parameters**

- `userId` (string, required)

**Responses**

- `200`: User assistant
  - Same fields as the `201` response of `POST /assistants`.

```bash
curl 'https://api.agnt.ai/users/<userId>/assistant' \
  -H "Authorization: Bearer ak_live_..."
```

Example response:

```json
{
  "ok": true,
  "assistant": {
    "id": "6702b4c1d2e3f4a5b6c7d8e9",
    "account": "66f1a2b3c4d5e6f708192a3b",
    "scope": "user",
    "user": "6702b1e8f9a0b1c2d3e4f5a6",
    "name": "Ava",
    "email": "ava@assistants.harborview.co",
    "status": "active",
    "talkToStrangers": false,
    "createdAt": "2026-10-01T15:04:05Z"
  }
}
```

## POST /users/{userId}/assistant

Create a user's personal assistant

Creates an assistant that belongs to this user. Returns `400` if the user already has one or the email address is taken.

**Path parameters**

- `userId` (string, required)

**Request body** (JSON)

- `name` (string, required): Display name
- `email` (string): Mailbox address; generated when omitted
- `avatar` (string): Image URL or data URI
- `signature` (string | null)
- `personality` (string)
- `backstory` (string | null)
- `gender` (enum) One of: `male`, `female`, `other`, `null`.
- `pronouns` (string | null)
- `country` (string | null): Two-letter country code
- `writingStyle` (object)
  - `professionalism` (number)
  - `humor` (number)
  - `emojiUse` (number)
- `metadata` (object)

**Responses**

- `201`: Created
  - Same fields as the `201` response of `POST /assistants`.

```bash
curl 'https://api.agnt.ai/users/<userId>/assistant' \
  -X POST \
  -H "Authorization: Bearer ak_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Ava"
}'
```

Example response:

```json
{
  "ok": true,
  "assistant": {
    "id": "6702b4c1d2e3f4a5b6c7d8e9",
    "account": "66f1a2b3c4d5e6f708192a3b",
    "scope": "user",
    "user": "6702b1e8f9a0b1c2d3e4f5a6",
    "name": "Ava",
    "email": "ava@assistants.harborview.co",
    "status": "active",
    "talkToStrangers": false,
    "createdAt": "2026-10-01T15:04:05Z"
  }
}
```

## PUT /users/{userId}/assistant

Update a user's personal assistant

Updates the user's personal assistant. Only the fields you send change.

**Path parameters**

- `userId` (string, required)

**Request body** (JSON)

- `name` (string): Display name
- `email` (string): Mailbox address; generated when omitted
- `avatar` (string): Image URL or data URI
- `signature` (string | null)
- `personality` (string)
- `backstory` (string | null)
- `gender` (enum) One of: `male`, `female`, `other`, `null`.
- `pronouns` (string | null)
- `country` (string | null): Two-letter country code
- `writingStyle` (object)
  - `professionalism` (number)
  - `humor` (number)
  - `emojiUse` (number)
- `metadata` (object)

**Responses**

- `200`: Updated
  - Same fields as the `201` response of `POST /assistants`.

```bash
curl 'https://api.agnt.ai/users/<userId>/assistant' \
  -X PUT \
  -H "Authorization: Bearer ak_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Ava",
  "email": "user@example.com",
  "avatar": "avatar",
  "signature": "signature"
}'
```

Example response:

```json
{
  "ok": true,
  "assistant": {
    "id": "6702b4c1d2e3f4a5b6c7d8e9",
    "account": "66f1a2b3c4d5e6f708192a3b",
    "scope": "user",
    "user": "6702b1e8f9a0b1c2d3e4f5a6",
    "name": "Ava",
    "email": "ava@assistants.harborview.co",
    "status": "active",
    "talkToStrangers": false,
    "createdAt": "2026-10-01T15:04:05Z"
  }
}
```

## DELETE /users/{userId}/assistant

Delete a user's personal assistant

Deletes the user's personal assistant and disconnects its mailboxes.

**Path parameters**

- `userId` (string, required)

**Responses**

- `200`: Deleted
  - `ok` (enum, required) One of: `true`.
  - `assistant` (object, required)
    - `id` (string, required)
    - `deleted` (boolean)
    - `message` (string)

```bash
curl 'https://api.agnt.ai/users/<userId>/assistant' \
  -X DELETE \
  -H "Authorization: Bearer ak_live_..."
```

Example response:

```json
{
  "ok": true,
  "assistant": {
    "id": "6660c4a1f2e3b7d8a9c01234"
  }
}
```

## GET /assistants/{assistantId}/voice-greetings

Retrieve voice greetings

Retrieves the lines the assistant can open a call with. When none exist, generation starts in the background and the response says so.

**Path parameters**

- `assistantId` (string, required)

**Responses**

- `200`: Voice greetings
  - `ok` (enum, required) One of: `true`.
  - `voiceGreetings` (object, required)
    - `inbound` (object, required)
      - `lines` (string[], required)
      - `source` (enum, required) One of: `generated`, `owner`, `null`.
      - `updatedAt` (string | null, required)
    - `outbound` (object, required)
      - `lines` (string[], required)
      - `source` (enum, required) One of: `generated`, `owner`, `null`.
      - `updatedAt` (string | null, required)
    - `generatedAt` (string | null, required)
    - `generating` (boolean, required)
    - `applied` (boolean)
    - `reason` (enum) One of: `concurrent_write`.
    - `limits` (object, required)
      - `minLines` (number, required)
      - `maxLines` (number, required)
      - `minChars` (number, required)
      - `maxChars` (number, required)
      - `maxSentences` (number, required)
      - `outboundPlaceholder` (string, required)
      - `rules` (string[], required)
      - `generatedOnlyRules` (string[], required)
- `403`: Not the assistant's owner
  - `status` (integer, required)
  - `error_code` (string)
  - `error` (string, required)
- `404`: Not found
  - `status` (integer, required)
  - `error_code` (string)
  - `error` (string, required)

```bash
curl 'https://api.agnt.ai/assistants/<assistantId>/voice-greetings' \
  -H "Authorization: Bearer ak_live_..."
```

Example response:

```json
{
  "ok": true,
  "voiceGreetings": {
    "inbound": {
      "lines": [
        "line"
      ],
      "source": "generated",
      "updatedAt": "2026-10-15T14:30:00Z"
    },
    "outbound": {
      "lines": [
        "line"
      ],
      "source": "generated",
      "updatedAt": "2026-10-15T14:30:00Z"
    },
    "generatedAt": "2026-10-15T14:30:00Z",
    "generating": true,
    "limits": {
      "minLines": 15,
      "maxLines": 1,
      "minChars": 15,
      "maxChars": 1,
      "maxSentences": 1,
      "outboundPlaceholder": "outboundplaceholder"
    }
  }
}
```

## PUT /assistants/{assistantId}/voice-greetings

Update voice greetings

Saved lists are marked source "owner" and are never overwritten by generation. Outbound templates need exactly one {firstName}; inbound lines must have none. Never starts generation: after clearing a list ([]), the next GET starts it (at most once per 10 minutes per assistant).

**Path parameters**

- `assistantId` (string, required)

**Request body** (JSON)

- `inbound` (string[])
- `outbound` (string[])

**Responses**

- `200`: Updated voice greetings
  - Same fields as the `200` response of `GET /assistants/{assistantId}/voice-greetings`.
- `400`: A line or list failed validation (error_code invalid_voice_greetings; body.details = {list, index?, reason})
  - `status` (integer, required)
  - `error_code` (string)
  - `error` (string, required)
- `403`: Not the assistant's owner
  - `status` (integer, required)
  - `error_code` (string)
  - `error` (string, required)
- `404`: Not found
  - `status` (integer, required)
  - `error_code` (string)
  - `error` (string, required)

```bash
curl 'https://api.agnt.ai/assistants/<assistantId>/voice-greetings' \
  -X PUT \
  -H "Authorization: Bearer ak_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "inbound": [
    "inbound"
  ],
  "outbound": [
    "outbound"
  ]
}'
```

Example response:

```json
{
  "ok": true,
  "voiceGreetings": {
    "inbound": {
      "lines": [
        "line"
      ],
      "source": "generated",
      "updatedAt": "2026-10-15T14:30:00Z"
    },
    "outbound": {
      "lines": [
        "line"
      ],
      "source": "generated",
      "updatedAt": "2026-10-15T14:30:00Z"
    },
    "generatedAt": "2026-10-15T14:30:00Z",
    "generating": true,
    "limits": {
      "minLines": 15,
      "maxLines": 1,
      "minChars": 15,
      "maxChars": 1,
      "maxSentences": 1,
      "outboundPlaceholder": "outboundplaceholder"
    }
  }
}
```

## GET /assistants/check-email

Check an assistant email address

Builds an address from `slug` (lowercase letters and digits) on your app's email domain and reports whether an assistant already uses it. Pass `excludeId` to ignore one assistant, such as the one you are renaming.

**Query parameters**

- `slug` (string, required): Desired local part; anything after @ is ignored
- `excludeId` (string)

**Responses**

- `200`: Availability
  - `available` (boolean, required)
  - `email` (string, required): The full address checked
- `400`: slug is required

```bash
curl 'https://api.agnt.ai/assistants/check-email?slug=' \
  -H "Authorization: Bearer ak_live_..."
```

Example response:

```json
{
  "available": true,
  "email": "jane@harborview.co"
}
```

## GET /assistants/generate

Suggest an assistant name and email

Suggests an assistant name and three email addresses that are free in your account. Pass `name` to get addresses for that name.

**Query parameters**

- `name` (string)

**Responses**

- `200`: Generated suggestions
  - `name` (string, required)
  - `emails` (string[], required)

```bash
curl 'https://api.agnt.ai/assistants/generate' \
  -H "Authorization: Bearer ak_live_..."
```

Example response:

```json
{
  "name": "Ava",
  "emails": [
    "user@example.com"
  ]
}
```

## POST /assistants/{assistantId}/voice-greetings/regenerate

Regenerate voice greetings

Writes new opening lines from the assistant's personality. Limited to 5 calls per hour per assistant. Lines the owner edited are kept unless `replaceOwnerEdits` is `true`.

**Path parameters**

- `assistantId` (string, required)

**Request body** (JSON)

- `scope` (enum) One of: `both`, `inbound`, `outbound`.
- `replaceOwnerEdits` (boolean)

**Responses**

- `200`: Voice greetings after regeneration
  - Same fields as the `200` response of `GET /assistants/{assistantId}/voice-greetings`.
- `403`: Not the assistant's owner
  - `status` (integer, required)
  - `error_code` (string)
  - `error` (string, required)
- `404`: Not found
  - `status` (integer, required)
  - `error_code` (string)
  - `error` (string, required)
- `409`: Generation already running (generation_in_progress), or every requested list is owner-written (owner_edited)
  - `status` (integer, required)
  - `error_code` (string)
  - `error` (string, required)
- `429`: Too many regenerations for this assistant (body.retryAfterSeconds, Retry-After header)
  - `status` (integer, required)
  - `error_code` (string)
  - `error` (string, required)
- `502`: The model could not produce valid lines (greeting_generation_failed)
  - `status` (integer, required)
  - `error_code` (string)
  - `error` (string, required)
- `503`: The rate limiter is unavailable (rate_limit_unavailable); nothing was generated
  - `status` (integer, required)
  - `error_code` (string)
  - `error` (string, required)

```bash
curl 'https://api.agnt.ai/assistants/<assistantId>/voice-greetings/regenerate' \
  -X POST \
  -H "Authorization: Bearer ak_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "scope": "both",
  "replaceOwnerEdits": true
}'
```

Example response:

```json
{
  "ok": true,
  "voiceGreetings": {
    "inbound": {
      "lines": [
        "line"
      ],
      "source": "generated",
      "updatedAt": "2026-10-15T14:30:00Z"
    },
    "outbound": {
      "lines": [
        "line"
      ],
      "source": "generated",
      "updatedAt": "2026-10-15T14:30:00Z"
    },
    "generatedAt": "2026-10-15T14:30:00Z",
    "generating": true,
    "limits": {
      "minLines": 15,
      "maxLines": 1,
      "minChars": 15,
      "maxChars": 1,
      "maxSentences": 1,
      "outboundPlaceholder": "outboundplaceholder"
    }
  }
}
```

## POST /assistants/{assistantId}/slack-apps

Create a Slack app for an assistant

Gives the assistant its own Slack app and returns the manifest to apply in Slack. `kind: "marketplace"` creates your listed app and requires an account key and an account-wide assistant. `kind: "workspace"` creates an app internal to the calling user's workspace and requires `X-User-Email`. Returns `201` for a new app and `200` for an existing one.

**Path parameters**

- `assistantId` (string, required)

**Request body** (JSON)

- `kind` (enum, required): Required. marketplace: your listed app, for an account-wide assistant; call with an account key. workspace: an app internal to one Slack workspace, for a user's own or shared assistant; call as that user. One of: `marketplace`, `workspace`.
- `botDisplayName` (string)

**Responses**

- `200`: Existing app (201: new app, same shape)
  - `ok` (boolean)
  - `slackApp` (object)
    - `id` (string)
    - `assistant` (string)
    - `kind` (enum) One of: `marketplace`, `workspace`.
    - `slackAppId` (string | null)
    - `botDisplayName` (string | null)
    - `hasCredentials` (boolean)
    - `status` (enum) One of: `pending_credentials`, `active`, `disabled`, `deleted`.
    - `createdAt` (string)
  - `manifest` (object)
    - `manifest` (object)
    - `manifestJson` (string)
    - `createAppUrl` (string)
    - `eventsUrl` (string)
    - `redirectUrls` (string[])
- `400`: Invalid input, or kind marketplace for an assistant that is not account-wide (not_system_assistant)
  - `status` (integer)
  - `error_code` (string)
  - `error` (string)
- `403`: kind marketplace without an account key; kind workspace without a user (user_required), for an account-wide assistant (system_assistant_console_only), for a user without the assistant, or where Slack is off (slack_not_allowed)
  - `status` (integer)
  - `error_code` (string)
  - `error` (string)
- `404`: Assistant not found
- `409`: already_exists

```bash
curl 'https://api.agnt.ai/assistants/<assistantId>/slack-apps' \
  -X POST \
  -H "Authorization: Bearer ak_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "kind": "marketplace"
}'
```

Example response:

```json
{
  "ok": true,
  "slackApp": {
    "id": "6660c4a1f2e3b7d8a9c01234",
    "assistant": "assistant",
    "kind": "marketplace",
    "slackAppId": "6660c4a1f2e3b7d8a9c01234"
  },
  "manifest": {
    "manifest": {},
    "manifestJson": "manifestjson",
    "createAppUrl": "https://harborview.co",
    "eventsUrl": "https://harborview.co"
  }
}
```

## GET /oauth/slack/assistant/authorize

Create an Add to Slack URL

Returns a Slack install URL for the assistant. Call it from your server as the user, then send the user's browser to `oauth.url`. After Slack, the browser returns to your app. The user must have the assistant, and their organization must allow Slack.

Acts as one user: send `X-User-Email`.

**Query parameters**

- `assistantId` (string, required)
- `host` (string): Your app's hosted domain to return the browser to
- `assistantSlackAppId` (string): A specific Slack app; defaults to the assistant's listed app

**Responses**

- `200`: URL to open in the user's browser
  - `ok` (boolean, required)
  - `oauth` (object, required)
    - `url` (string, required)
- `403`: user_required, no access to the assistant, or slack_not_allowed
- `404`: Assistant or slack_app_not_found
- `409`: credentials_missing

```bash
curl 'https://api.agnt.ai/oauth/slack/assistant/authorize?assistantId=' \
  -H "Authorization: Bearer ak_live_..." \
  -H "X-User-Email: user@example.com"
```

Example response:

```json
{
  "ok": true,
  "oauth": {
    "url": "https://harborview.co"
  }
}
```

## GET /oauth/slack/assistant/link

Create a Sign in with Slack URL

Returns a Slack sign-in URL that links the user's Slack identity, so the assistant recognizes them in Slack. Call it as the user and send the browser to `oauth.url`.

Acts as one user: send `X-User-Email`.

**Query parameters**

- `assistantId` (string, required)
- `host` (string): Your app's hosted domain to return the browser to
- `assistantSlackAppId` (string): A specific Slack app; defaults to the assistant's listed app

**Responses**

- `200`: URL to open in the user's browser
  - `ok` (boolean, required)
  - `oauth` (object, required)
    - `url` (string, required)
- `403`: user_required, no access to the assistant, or slack_not_allowed
- `404`: Assistant or slack_app_not_found
- `409`: credentials_missing

```bash
curl 'https://api.agnt.ai/oauth/slack/assistant/link?assistantId=' \
  -H "Authorization: Bearer ak_live_..." \
  -H "X-User-Email: user@example.com"
```

Example response:

```json
{
  "ok": true,
  "oauth": {
    "url": "https://harborview.co"
  }
}
```

## GET /slack/workspaces

List Slack workspaces

Returns the Slack workspaces where the user has linked or installed one of their assistants, with each assistant there.

Acts as one user: send `X-User-Email`.

**Responses**

- `200`: Workspaces
  - `ok` (boolean)
  - `slackAllowed` (boolean): Whether the user's organization allows Slack
  - `slackWorkspaces` (object[])
    - `slackTeamId` (string)
    - `teamName` (string | null)
    - `domain` (string | null)
    - `linked` (boolean): True when the user has verified their Slack account in this workspace
    - `assistants` (object[])
      - `assistantId` (string)
      - `assistantName` (string | null)
      - `installId` (string)
      - `enabled` (boolean)
      - `installedByMe` (boolean)
      - `botDisplayName` (string | null)
      - `slackUserId` (string | null)
      - `openUrl` (string | null): slack:// link to a direct message with the assistant
- `403`: user_required: call as a user

```bash
curl 'https://api.agnt.ai/slack/workspaces' \
  -H "Authorization: Bearer ak_live_..." \
  -H "X-User-Email: user@example.com"
```

Example response:

```json
{
  "ok": true,
  "slackAllowed": true,
  "slackWorkspaces": [
    {
      "slackTeamId": "6660c4a1f2e3b7d8a9c01234",
      "teamName": "Ava",
      "domain": "harborview.co",
      "linked": true
    }
  ]
}
```

## GET /oauth/teams/authorize

Create a Microsoft Teams connect URL

Returns a Microsoft sign-in URL that connects Teams messaging to an organization or team. Send the admin's browser to `oauth.url`. Called as a user, the user must be an admin of the target.

**Query parameters**

- `target` (enum, required) One of: `org`, `team`.
- `targetId` (string, required): Organization or team id
- `host` (string): Your app's hosted domain to return the browser to

**Responses**

- `200`: URL to open in the user's browser
  - `ok` (boolean, required)
  - `oauth` (object, required)
    - `url` (string, required)
- `400`: Missing target or targetId, or no Teams app configured
- `403`: Admin role required

```bash
curl 'https://api.agnt.ai/oauth/teams/authorize?target=&targetId=' \
  -H "Authorization: Bearer ak_live_..."
```

Example response:

```json
{
  "ok": true,
  "oauth": {
    "url": "https://harborview.co"
  }
}
```
