PATCH · Modifier
Rédigé par Red Blue
Mis à jour le
PATCH /api/v1/inbox/conversations/{conversationId}
operationId : inbox_conversation_command
Accès | Permission | Consentements OAuth |
|---|---|---|
Clé API d’organisation | supportAutomation.write | Sans objet |
KHONY_ORIGIN est l’origine HTTPS de votre application Khony, sans chemin final. Remplacez les identifiants de l’exemple par ceux de vos ressources autorisées. Les données de réponse ci-dessous illustrent le format ; elles ne sont pas le résultat d’un appel à votre organisation.
Paramètres et en-têtes
Nom | Emplacement | Requis | Type et contraintes |
|---|---|---|---|
Idempotency-Key | header | Oui | string ; uuid |
conversationId | path | Oui | string |
Champs du corps JSON
Nom | Emplacement | Requis | Type et contraintes |
|---|---|---|---|
command | JSON | Oui | object |
expectedRevision | JSON | Oui | string |
productId | JSON | Oui | string |
Exemple de requête
curl --request PATCH "$KHONY_ORIGIN/api/v1/inbox/conversations/support_conversation_01k3w8d7vhe008000000000002" \
--header "x-api-key: $KHONY_API_KEY" \
--header 'Idempotency-Key: 0198f886-9f71-7000-8000-000000000099' \
--header 'Content-Type: application/json' \
--data-raw '{
"productId": "product_01k3w8d7vhe008000000000001",
"expectedRevision": "4242",
"command": {
"type": "note",
"document": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Diagnostic",
"marks": [
{
"type": "bold"
}
]
}
]
},
{
"type": "callout",
"attrs": {
"variant": "info"
},
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Keep the original source document."
}
]
}
]
},
{
"type": "table",
"content": [
{
"type": "tableRow",
"content": [
{
"type": "tableHeader",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Step"
}
]
}
]
},
{
"type": "tableHeader",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Result"
}
]
}
]
}
]
},
{
"type": "tableRow",
"content": [
{
"type": "tableCell",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Read"
}
]
}
]
},
{
"type": "tableCell",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Verified"
}
]
}
]
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Documentation",
"marks": [
{
"type": "link",
"attrs": {
"href": "https://example.test/help"
}
}
]
}
]
}
]
},
"mentionedUserIds": []
}
}'Réponse de succès · HTTP 200
{
"data": {
"id": "support_conversation_01k3w8d7vhe008000000000002",
"productId": "product_01k3w8d7vhe008000000000001",
"status": "open",
"responderMode": "human",
"channel": "widget",
"subject": "Customer question",
"priority": "normal",
"assigneeId": null,
"teamId": null,
"customerId": null,
"lastMessageAt": "2026-10-23T10:00:00.000Z",
"createdAt": "2026-10-23T10:00:00.000Z",
"updatedAt": "2026-10-23T10:00:00.000Z",
"snoozedUntil": null,
"resolvedAt": null,
"revision": "4242"
},
"receiptId": "support_conversation_event_01k3w8d7vhe008000000000006",
"noteId": "support_note_01k3w8d7vhe008000000000004"
}Schéma complet du corps JSON
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"command": {
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "status"
},
"status": {
"type": "string",
"enum": [
"open",
"resolved"
]
}
},
"required": [
"type",
"status"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "priority"
},
"priority": {
"type": "string",
"enum": [
"low",
"normal",
"high",
"urgent"
]
}
},
"required": [
"type",
"priority"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "snooze"
},
"until": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
}
},
"required": [
"type",
"until"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "assignee"
},
"userId": {
"anyOf": [
{
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
{
"type": "null"
}
]
}
},
"required": [
"type",
"userId"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "team"
},
"teamId": {
"type": "string",
"pattern": "^support_team_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
}
},
"required": [
"type",
"teamId"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "participants"
},
"userIds": {
"minItems": 1,
"maxItems": 100,
"type": "array",
"items": {
"$ref": "#/$defs/__schema0"
}
},
"active": {
"type": "boolean"
}
},
"required": [
"type",
"userIds",
"active"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"$ref": "#/$defs/__schema1"
},
"tagId": {
"$ref": "#/$defs/__schema2"
},
"name": {
"$ref": "#/$defs/__schema3"
},
"assigned": {
"$ref": "#/$defs/__schema4"
}
},
"required": [
"type",
"assigned"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "handoff"
}
},
"required": [
"type"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "note"
},
"document": {
"$ref": "#/$defs/__schema5"
},
"mentionedUserIds": {
"default": [],
"maxItems": 10,
"type": "array",
"items": {
"$ref": "#/$defs/__schema6"
}
}
},
"required": [
"type",
"document"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "feedback_link"
},
"postId": {
"type": "string",
"pattern": "^post_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"sourceMessageId": {
"type": "string",
"pattern": "^support_message_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"linked": {
"type": "boolean"
}
},
"required": [
"type",
"postId",
"linked"
],
"additionalProperties": false
}
]
},
"expectedRevision": {
"type": "string",
"pattern": "^[0-9]+$"
},
"productId": {
"type": "string",
"pattern": "^product_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
}
},
"required": [
"command",
"expectedRevision",
"productId"
],
"additionalProperties": false,
"$defs": {
"__schema0": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"__schema1": {
"type": "string",
"const": "tag"
},
"__schema2": {
"type": "string",
"pattern": "^tag_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"__schema3": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"__schema4": {
"type": "boolean"
},
"__schema5": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
},
{
"type": "array",
"items": {
"$ref": "#/$defs/__schema5"
}
},
{
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"$ref": "#/$defs/__schema5"
}
}
]
},
"__schema6": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
}
}Schéma complet de la réponse
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"revision": {
"type": "string",
"pattern": "^[0-9]+$"
},
"id": {
"type": "string",
"pattern": "^support_conversation_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"productId": {
"type": "string",
"pattern": "^product_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"status": {
"type": "string",
"enum": [
"open",
"pending",
"resolved"
]
},
"responderMode": {
"type": "string"
},
"channel": {
"type": "string"
},
"subject": {
"type": "string"
},
"priority": {
"type": "string"
},
"assigneeId": {
"anyOf": [
{
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
{
"type": "null"
}
]
},
"teamId": {
"anyOf": [
{
"type": "string",
"pattern": "^support_team_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
{
"type": "null"
}
]
},
"customerId": {
"anyOf": [
{
"type": "string",
"pattern": "^contact_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
{
"type": "null"
}
]
},
"lastMessageAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"snoozedUntil": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
},
"resolvedAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
}
},
"required": [
"revision",
"id",
"productId",
"status",
"responderMode",
"channel",
"subject",
"priority",
"assigneeId",
"teamId",
"customerId",
"lastMessageAt",
"createdAt",
"updatedAt",
"snoozedUntil",
"resolvedAt"
],
"additionalProperties": false
},
"receiptId": {
"type": "string",
"pattern": "^support_conversation_event_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"noteId": {
"type": "string",
"pattern": "^support_note_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
}
},
"required": [
"data",
"receiptId"
],
"additionalProperties": false
}Refus et reprise
Les statuts documentés pour cette opération sont 400, 401, 402, 403, 404, 409, 429, 500, 503. Identifiez la cause avec error.code et, lorsqu’il est présent, error.reason. Une réponse 409 peut demander une relecture de révision ou signaler une commande incompatible ; une réponse 428 demande une confirmation humaine. Ne rejouez une écriture que selon son contrat.
Notes du contrat
{
"description": "Requires a new explicit support-reader/editor organization API key profile. Its supportAutomation grant authorizes all conversations of the selected organization product, including restricted conversations, customer identity and internal notes. Legacy support.read keys do not qualify. Private teammate drafts, preferences and Copilot chats remain human-only. Product entitlement and API request meter apply to every admission. Requires support-editor. Use the current opaque revision as expectedRevision and a stable UUID Idempotency-Key. Exact retries replay the committed response; different payload or stale state returns 409. Lifecycle, SLA, workflows and notifications use native services. Notes remain internal; this operation never sends an agent reply. Assignments target actual current members. pending is managed by native handoff, not arbitrary status replacement."
}