POST · Gérer les envois
Rédigé par Red Blue
Mis à jour le
POST /api/v1/inbox/assist
operationId : inbox_assist_manage
Accès | Permission | Consentements OAuth |
|---|---|---|
OAuth : délégation d’un équipier pour l’API | support.write | api:connect, support:write |
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.
Champs du corps JSON
Nom | Emplacement | Requis | Type et contraintes |
|---|---|---|---|
productId | JSON | Oui | string |
request | JSON | Oui | object |
Variantes de la requête
Sélecteur | Valeur | Autres champs requis dans request |
|---|---|---|
request.operation | "reading_preference" | Aucun autre champ imposé |
request.operation | "reading_set" | targetLocale, expectedRevision |
request.operation | ["reading_get","reading_generate"] | conversationId, kind, entryId |
request.operation | "reading_correct" | conversationId, kind, entryId, locale |
request.operation | "writing_transform" | conversationId, mode, operationId, action, sourceLocale, targetLocale, document |
request.operation | "outgoing_prepare" | conversationId, choice, draft |
request.operation | "outgoing_get" | conversationId, id |
request.operation | "outgoing_terms" | conversationId |
request.operation | "outgoing_terms_save" | conversationId, expectedRevision, entries |
Choisissez une variante et respectez son schéma complet : les contraintes des champs optionnels et les unions imbriquées restent applicables.
Exemple de requête
curl --request POST "$KHONY_ORIGIN/api/v1/inbox/assist" \
--header "Authorization: Bearer $KHONY_ACCESS_TOKEN" \
--header 'Content-Type: application/json' \
--data-raw '{
"productId": "product_01k3w8d7vhe008000000000001",
"request": {
"operation": "reading_set",
"targetLocale": "fr",
"expectedRevision": 0
}
}'Réponse de succès · HTTP 200
{
"data": {
"targetLocale": "fr",
"revision": 1
}
}Schéma complet du corps JSON
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"productId": {
"type": "string",
"pattern": "^product_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"request": {
"oneOf": [
{
"$ref": "#/$defs/__schema0"
},
{
"$ref": "#/$defs/__schema1"
},
{
"$ref": "#/$defs/__schema3"
},
{
"$ref": "#/$defs/__schema9"
},
{
"$ref": "#/$defs/__schema10"
},
{
"$ref": "#/$defs/__schema13"
},
{
"$ref": "#/$defs/__schema15"
},
{
"$ref": "#/$defs/__schema16"
},
{
"$ref": "#/$defs/__schema17"
}
]
}
},
"required": [
"productId",
"request"
],
"additionalProperties": false,
"$defs": {
"__schema0": {
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "reading_preference"
}
},
"required": [
"operation"
],
"additionalProperties": false
},
"__schema1": {
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "reading_set"
},
"targetLocale": {
"anyOf": [
{
"$ref": "#/$defs/__schema2"
},
{
"type": "null"
}
]
},
"expectedRevision": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"operation",
"targetLocale",
"expectedRevision"
],
"additionalProperties": false
},
"__schema2": {
"type": "string",
"minLength": 2,
"maxLength": 48
},
"__schema3": {
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"reading_get",
"reading_generate"
]
},
"conversationId": {
"$ref": "#/$defs/__schema4"
},
"kind": {
"$ref": "#/$defs/__schema5"
},
"entryId": {
"$ref": "#/$defs/__schema6"
},
"targetLocale": {
"$ref": "#/$defs/__schema7"
},
"sourceLocale": {
"$ref": "#/$defs/__schema8"
}
},
"required": [
"operation",
"conversationId",
"kind",
"entryId"
],
"additionalProperties": false
},
"__schema4": {
"type": "string",
"pattern": "^support_conversation_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"__schema5": {
"type": "string",
"enum": [
"message",
"note"
]
},
"__schema6": {
"anyOf": [
{
"type": "string",
"pattern": "^support_message_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
{
"type": "string",
"pattern": "^support_note_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
}
]
},
"__schema7": {
"$ref": "#/$defs/__schema2"
},
"__schema8": {
"$ref": "#/$defs/__schema2"
},
"__schema9": {
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "reading_correct"
},
"conversationId": {
"$ref": "#/$defs/__schema4"
},
"kind": {
"$ref": "#/$defs/__schema5"
},
"entryId": {
"$ref": "#/$defs/__schema6"
},
"targetLocale": {
"$ref": "#/$defs/__schema7"
},
"sourceLocale": {
"$ref": "#/$defs/__schema8"
},
"locale": {
"anyOf": [
{
"$ref": "#/$defs/__schema2"
},
{
"type": "null"
}
]
}
},
"required": [
"operation",
"conversationId",
"kind",
"entryId",
"locale"
],
"additionalProperties": false
},
"__schema10": {
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "writing_transform"
},
"conversationId": {
"anyOf": [
{
"type": "string",
"pattern": "^support_conversation_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
{
"type": "null"
}
]
},
"recipientId": {
"type": "string",
"pattern": "^contact_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"draftId": {
"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)$"
},
"mode": {
"type": "string",
"enum": [
"reply",
"note"
]
},
"operationId": {
"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)$"
},
"action": {
"type": "string",
"enum": [
"translate",
"improve",
"shorten",
"proofread",
"simplify",
"expand",
"professional",
"friendly",
"empathetic",
"confident"
]
},
"sourceLocale": {
"$ref": "#/$defs/__schema2"
},
"targetLocale": {
"$ref": "#/$defs/__schema2"
},
"document": {
"$ref": "#/$defs/__schema11"
}
},
"required": [
"operation",
"conversationId",
"mode",
"operationId",
"action",
"sourceLocale",
"targetLocale",
"document"
],
"additionalProperties": false
},
"__schema11": {
"$ref": "#/$defs/__schema12"
},
"__schema12": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
},
{
"type": "array",
"items": {
"$ref": "#/$defs/__schema12"
}
},
{
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"$ref": "#/$defs/__schema12"
}
}
]
},
"__schema13": {
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "outgoing_prepare"
},
"conversationId": {
"$ref": "#/$defs/__schema4"
},
"choice": {
"type": "string",
"enum": [
"translate",
"original"
]
},
"draft": {
"type": "object",
"properties": {
"revision": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"mode": {
"type": "string",
"const": "reply"
},
"document": {
"$ref": "#/$defs/__schema11"
},
"sourceOverride": {
"anyOf": [
{
"$ref": "#/$defs/__schema2"
},
{
"type": "null"
}
]
},
"targetLocale": {
"$ref": "#/$defs/__schema2"
},
"targetRevision": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"destination": {
"type": "object",
"properties": {
"channel": {
"type": "string",
"enum": [
"messenger",
"email"
]
},
"identity": {
"type": "string",
"maxLength": 2048
},
"revision": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"channel",
"identity",
"revision"
],
"additionalProperties": false
},
"attachments": {
"maxItems": 10,
"type": "array",
"items": {
"$ref": "#/$defs/__schema14"
}
}
},
"required": [
"revision",
"mode",
"document",
"sourceOverride",
"targetLocale",
"targetRevision",
"destination",
"attachments"
],
"additionalProperties": false
}
},
"required": [
"operation",
"conversationId",
"choice",
"draft"
],
"additionalProperties": false
},
"__schema14": {
"type": "object",
"properties": {
"id": {
"type": "string",
"maxLength": 200
},
"revision": {
"type": "string",
"maxLength": 200
}
},
"required": [
"id",
"revision"
],
"additionalProperties": false
},
"__schema15": {
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "outgoing_get"
},
"conversationId": {
"$ref": "#/$defs/__schema4"
},
"id": {
"type": "string",
"pattern": "^support_outgoing_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
}
},
"required": [
"operation",
"conversationId",
"id"
],
"additionalProperties": false
},
"__schema16": {
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "outgoing_terms"
},
"conversationId": {
"$ref": "#/$defs/__schema4"
}
},
"required": [
"operation",
"conversationId"
],
"additionalProperties": false
},
"__schema17": {
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "outgoing_terms_save"
},
"conversationId": {
"$ref": "#/$defs/__schema4"
},
"expectedRevision": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"entries": {
"maxItems": 50,
"type": "array",
"items": {
"$ref": "#/$defs/__schema18"
}
}
},
"required": [
"operation",
"conversationId",
"expectedRevision",
"entries"
],
"additionalProperties": false
},
"__schema18": {
"type": "object",
"properties": {
"source": {
"type": "string",
"maxLength": 200
},
"target": {
"type": "string",
"maxLength": 200
}
},
"required": [
"source",
"target"
],
"additionalProperties": false
}
}
}Schéma complet de la réponse
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"data": {
"$ref": "#/$defs/__schema0"
}
},
"required": [
"data"
],
"additionalProperties": false,
"$defs": {
"__schema0": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
},
{
"type": "array",
"items": {
"$ref": "#/$defs/__schema0"
}
},
{
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"$ref": "#/$defs/__schema0"
}
}
]
}
}
}Refus et reprise
Les statuts documentés pour cette opération sont 400, 401, 402, 403, 428, 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 dedicated API OAuth bearer for audience /api/v1 plus api:connect and the declared support scope, current product/organization consent, native permissions and source policies. No cookie or MCP-audience token fallback. Commercial admission is shared with the public API. Native reading/writing translation, preferences and outgoing preparation. Transforms retain the full article source and use native budgets/cancellation. Outgoing preparation never sends. Human confirmation remains a separate MCP action bound to its frozen native snapshot."
}