Assign a conversation
Choose which team members are responsible for a conversation. Name each member by their member ID or their email.
PUTreplaces the list: the conversation ends with exactly the members you send. An empty list removes them all.PATCHadds 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
# 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 }' // 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.
Assign Ana's conversation to Luis as well.
Your assistant uses patch_conversation_assignees_v2, or set_conversation_assignees_v2 to replace the list.
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_ASSIGNEEbefore anything changes. - Only the members being added must be active. Keeping or removing a member does not depend on their status.
addandremovecannot name the same member.assignedToTeamistrueto assign the whole team andfalseto 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 | ✓ |
Headers
| Header | Description | Required |
|---|---|---|
Idempotency-Key | Makes the call safe to retry. 1 to 255 visible ASCII characters; a UUID works. See 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 |
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 |
{
"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 |
{
"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, 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.
{
"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.fieldsandincludemay 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.
Errors
| 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.
Notes
Every call that changes the assignees sends conversation.owners.updated with source: "api.conversation.v2", or "mcp.conversation.v2" when your assistant did it.