---
docId: doc_ddf357a3b5df4bc3a06542a3681be9c6
title: Assign a conversation
description: Replace the team members assigned to a conversation, or add and remove some, and assign it to the whole team.
version: v2
versionGroup: conversations-assignees
api:
  group: conversaciones
  auth: bearer
  operations:
    - operationId: setConversationAssigneesV2
      method: PUT
      path: '/v2/conversations/{conversationId}/assignees'
      postmanName: Replace the assignees of a conversation
    - operationId: patchConversationAssigneesV2
      method: PATCH
      path: '/v2/conversations/{conversationId}/assignees'
      postmanName: Add or remove assignees
---

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

# Assign a conversation

Choose which team members are responsible for a conversation. Name each member by their member ID or their email.

- **`PUT` replaces** the list: the conversation ends with exactly the members you send. An empty list removes them all.
- **`PATCH` adds and removes** some members in one step, without sending the whole list.

Assigning the conversation to the **whole team** is a separate switch, `assignedToTeam`, on both. Never send `team` as a member.

## Example

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

```bash
# Add Luis
curl -X PATCH "https://api.platic.ai/v2/conversations/$CONVERSATION_ID/assignees?fields=id,assigneeIds,assignedToTeam" \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{ "add": ["luis@acme.com"] }'

# Replace the whole list, only if nobody changed it since your read
curl -X PUT "https://api.platic.ai/v2/conversations/$CONVERSATION_ID/assignees?fields=id,assigneeIds,assignedToTeam" \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "If-Resource-Version: $RESOURCE_VERSION" \
  -d '{ "assigneeIds": ["usr_ana", "luis@acme.com"], "assignedToTeam": false }'
```

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

```ts
// Add and remove
await platic.conversations.assignees.update("8Yc2kQ1mZ0rTq4Lp7WvX", { add: ["luis@acme.com"] });

// Replace, guarded by the version you read
const { data, meta } = await platic.conversations.get("8Yc2kQ1mZ0rTq4Lp7WvX", { fields: ["assigneeIds"] });
const result = await platic.conversations.assignees.set(
  "8Yc2kQ1mZ0rTq4Lp7WvX",
  { assigneeIds: [...(data.assigneeIds ?? []), "luis@acme.com"], assignedToTeam: false },
  { expectedVersion: meta.resourceVersion },
);

console.log(result.meta.effects.notified);
```

The SDK sends an `Idempotency-Key` on every action and reuses it when it retries. A member who is not active in the workspace throws `InvalidConfigError` with code `INVALID_ASSIGNEE`.

</Ways.Way>
<Ways.Way name="asistente">
<Ways.Say>

Assign Ana's conversation to Luis as well.

</Ways.Say>

Your assistant uses [`patch_conversation_assignees_v2`](/mcp/tools#patch_conversation_assignees_v2), or [`set_conversation_assignees_v2`](/mcp/tools#set_conversation_assignees_v2) to replace the list.

</Ways.Way>
</Ways>

Use `PATCH` when you only want to add or remove someone: two callers can do it at the same time without overwriting each other. Use `PUT` when you have the whole list, and send `If-Resource-Version` so you do not overwrite a change made since you read it.

## Who is notified

Only the members **added** by the call are notified, once, the same way as when someone assigns them from the inbox: in the app, by email, by WhatsApp and by push, following each member's access and preferences. `meta.effects.notified` lists them. If the notification could not be sent, the assignment stays and `notified` is empty.

Members who were already assigned, members removed, and repeated calls notify no one.

## Rules

- Each member is a **member ID or an email** of the workspace. An email that is not a member returns `422 INVALID_ASSIGNEE` before anything changes.
- Only the members being added must be active. Keeping or removing a member does not depend on their status.
- `add` and `remove` cannot name the same member.
- `assignedToTeam` is `true` to assign the whole team and `false` to unassign it. Left out, it does not change.
- A conversation can have up to 50 assignees.
- If the result is the same as before, the answer has `meta.changed: false`: nothing is written, no webhook is sent and no one is notified.

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `conversationId` | string | The conversation's `id`. See [How IDs work](/api-reference/conversations#how-ids-work) | ✓ |

## Headers

| Header | Description | Required |
|--------|-------------|----------|
| `Idempotency-Key` | Makes the call safe to retry. 1 to 255 visible ASCII characters; a UUID works. See [Retries](#retries) | — |
| `If-Resource-Version` | **`PUT` only.** The `meta.resourceVersion` of your last read or action. If the conversation changed since then, the answer is `412 VERSION_MISMATCH` and nothing changes. Without it, the last write wins. `PATCH` does not need it: sending it returns `400 INVALID_REQUEST` | — |

## Query parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `fields` | string | Fields of the conversation to return, comma-separated. Replaces the defaults; `id` is always returned. The fields are the same as in [Get a conversation](/api-reference/conversations/get#query-parameters) |
| `include` | string | Relations to resolve in `included`: `agents`, `channels`, `assignees`. `assignees` adds each member's name and email |
| `workspace` | string | The workspace, for an API key that covers several. Other credentials always act on their own workspace |

## Request body

### `PUT`: replace

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `assigneeIds` | string[] | ✓ | The members the conversation ends with, by member ID or email, up to 50. Each one up to 256 characters, without spaces. `[]` removes them all |
| `assignedToTeam` | boolean | — | `true` assigns the whole team; `false` unassigns it. Left out, it does not change |

```json
{
  "assigneeIds": ["usr_ana", "luis@acme.com"],
  "assignedToTeam": false
}
```

### `PATCH`: add and remove

Send at least one field.

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `add` | string[] | — | Members to assign, by member ID or email, up to 50 |
| `remove` | string[] | — | Members to unassign, by member ID or email, up to 50 |
| `assignedToTeam` | boolean | — | `true` assigns the whole team; `false` unassigns it. Left out, it does not change |

```json
{
  "add": ["luis@acme.com"],
  "remove": ["usr_ana"]
}
```

Any other field returns `400 INVALID_REQUEST`.

## Response

The answer is the conversation after the change, read with `fields` and `include` as in [Get a conversation](/api-reference/conversations/get), and a `meta` that says what the action did. Members sent by email come back as member IDs. This example used `?fields=id,assigneeIds,assignedToTeam`.

```json
{
  "status": "success",
  "data": {
    "id": "8Yc2kQ1mZ0rTq4Lp7WvX",
    "assigneeIds": ["usr_ana", "usr_luis"],
    "assignedToTeam": false
  },
  "meta": {
    "fields": ["id", "assigneeIds", "assignedToTeam"],
    "include": [],
    "requestId": "req_7f3c",
    "resourceVersion": "MTc2NDYxMjAwMC4xMjM0NTY3ODk",
    "action": "assignees",
    "changed": true,
    "effects": {
      "added": ["usr_luis"],
      "removed": [],
      "assignedToTeam": false,
      "notified": ["usr_luis"]
    },
    "replayed": false
  }
}
```

| Field | Description |
|-------|-------------|
| `data` | The conversation as it is now, with the selected fields |
| `included` | Related records, only when you sent `include` |
| `meta.action` | Always `assignees` |
| `meta.changed` | `false` when the conversation already had that result: nothing was written and no one was notified |
| `meta.effects.added` | Member IDs assigned by this call |
| `meta.effects.removed` | Member IDs unassigned by this call |
| `meta.effects.assignedToTeam` | Whether the whole team is assigned after the call |
| `meta.effects.notified` | Member IDs that were notified. Empty if the notification could not be sent |
| `meta.resourceVersion` | The conversation's version after the change. Send it in `If-Resource-Version` on your next `PUT` |
| `meta.replayed` | `true` when this is the stored outcome of an earlier call with the same `Idempotency-Key`. Nothing ran again and no one was notified again; `data` and `resourceVersion` show the conversation as it is now |
| `meta.fields` · `meta.include` | Fields and relations applied |
| `meta.requestId` | ID of the request, for support |
| `meta.warnings` | Only when there is something to report. `CONVERSATION_NOT_READABLE`: the change was applied, but your credential can no longer read the conversation (for example, you unassigned yourself and your role only sees its assigned conversations), so `data` has only `id` |

## Retries

Send an `Idempotency-Key` so a retry after a lost answer is safe. A key belongs to one credential, one action and one conversation.

- **Same key, same body:** you get the first outcome with `meta.replayed: true`. Nothing runs again and no one is notified again. `fields` and `include` may change: they only choose what the answer shows.
- **Same key, different body:** `409 IDEMPOTENCY_KEY_REUSED`. Use a new key for a new change.
- **First call still running:** `409 IDEMPOTENCY_IN_PROGRESS`. Retry in a few seconds with the same key.
- **Lifetime:** keys are kept for one day. A call that fails does not keep its key, so retrying it runs the action again.

Your access is checked again on every retry. More in [Idempotency](/api-reference/idempotency).

## Errors

<Collapsible summary="Show error codes and fixes">

| Status | `details.code` | When it happens |
|--------|----------------|-----------------|
| `400` | `INVALID_REQUEST` | The body, a query parameter or a header is not valid: a list with more than 50 members, `team` sent as a member, `add` and `remove` naming the same member, or `If-Resource-Version` on `PATCH`. `details.issues` says which |
| `400` | `INVALID_REQUEST` | The workspace in `?workspace=` is not covered by the credential. `details.available` lists the ones it covers |
| `400` | `INVALID_FIELD` | A name in `fields` does not exist. `details.allowed` lists the accepted ones |
| `400` | `INVALID_INCLUDE` | A name in `include` does not exist. `details.allowed` lists the accepted ones |
| `401` | `UNAUTHENTICATED` | The credential is missing or invalid |
| `403` | `FORBIDDEN` | The credential cannot change conversations, or your role can read this conversation but not change it |
| `403` | `INSUFFICIENT_SCOPE` | An OAuth token without the `platica:write` scope. `details.requiredScope` says which one is missing |
| `404` | `CONVERSATION_NOT_FOUND` | No conversation has that `id` in the workspace, or it is out of your credential's reach |
| `409` | `IDEMPOTENCY_KEY_REUSED` | The `Idempotency-Key` was already used with a different body |
| `409` | `IDEMPOTENCY_IN_PROGRESS` | The first call with this `Idempotency-Key` is still running. Retry shortly with the same key |
| `412` | `VERSION_MISMATCH` | `PUT` only: `If-Resource-Version` is not the current version. `details.currentVersion` has it. Nothing changed: read the conversation again and repeat |
| `422` | `INVALID_ASSIGNEE` | Some members being added are not active members of the workspace. `details.invalidAssigneeIds` lists the IDs or emails |
| `422` | `TOO_MANY_ASSIGNEES` | The conversation would end with more than 50 assignees |
| `503` | `ACTION_FAILED` | The outcome could not be confirmed (`details.retryable: true`). Repeat with the same `Idempotency-Key`: an action that already ran is not run again |

The general error format is in [Errors](/api-reference/errors).

</Collapsible>

## Notes

Every call that changes the assignees sends [`conversation.owners.updated`](/api-reference/webhooks/payloads#conversations) with `source: "api.conversation.v2"`, or `"mcp.conversation.v2"` when your assistant did it.
