POST · Commandes personnelles héritées

Conversations : Commandes personnelles héritées. Paramètres, accès et exemples de réponse.

Rédigé par Red Blue

Mis à jour le

Conversations

POST /api/v1/inbox/personal

operationId : inbox_personal_write

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.type

"draft"

conversationId, mode, document, expectedRevision

request.type

"subscription"

conversationId, active

request.type

"take_over"

conversationId, idempotencyKey, expectedRevision

request.type

"return_to_ai"

conversationId, idempotencyKey, expectedRevision

request.type

"saved_view"

name, queue, viewMode, search

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

Shell
curl --request POST "$KHONY_ORIGIN/api/v1/inbox/personal" \
  --header "Authorization: Bearer $KHONY_ACCESS_TOKEN" \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "productId": "product_01k3w8d7vhe008000000000001",
  "request": {
    "type": "draft",
    "conversationId": "support_conversation_01k3w8d7vhe008000000000002",
    "mode": "reply",
    "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"
                  }
                }
              ]
            }
          ]
        }
      ]
    },
    "expectedRevision": 0
  }
}'
Shell

Réponse de succès · HTTP 200

JSON
{
  "data": {
    "mode": "reply",
    "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"
                  }
                }
              ]
            }
          ]
        }
      ]
    },
    "revision": 1,
    "updatedAt": "2026-10-23T10:00:00.000Z"
  }
}
JSON
Schéma complet du corps JSON
JSON
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "productId": {
      "type": "string",
      "pattern": "^product_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
    },
    "request": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "draft"
            },
            "conversationId": {
              "type": "string",
              "pattern": "^support_conversation_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
            },
            "mode": {
              "type": "string",
              "enum": [
                "reply",
                "note"
              ]
            },
            "document": {
              "$ref": "#/$defs/__schema0"
            },
            "expectedRevision": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "type",
            "conversationId",
            "mode",
            "document",
            "expectedRevision"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "subscription"
            },
            "conversationId": {
              "type": "string",
              "pattern": "^support_conversation_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
            },
            "active": {
              "type": "boolean"
            }
          },
          "required": [
            "type",
            "conversationId",
            "active"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "take_over"
            },
            "conversationId": {
              "type": "string",
              "pattern": "^support_conversation_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
            },
            "idempotencyKey": {
              "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)$"
            },
            "expectedRevision": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          },
          "required": [
            "type",
            "conversationId",
            "idempotencyKey",
            "expectedRevision"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "return_to_ai"
            },
            "conversationId": {
              "type": "string",
              "pattern": "^support_conversation_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
            },
            "idempotencyKey": {
              "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)$"
            },
            "expectedRevision": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          },
          "required": [
            "type",
            "conversationId",
            "idempotencyKey",
            "expectedRevision"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "saved_view"
            },
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            },
            "queue": {
              "type": "string",
              "enum": [
                "mine",
                "all",
                "unassigned",
                "team",
                "ai",
                "handoff",
                "snoozed",
                "resolved",
                "tickets",
                "customer-tickets",
                "backoffice-tickets",
                "tracker-tickets"
              ]
            },
            "viewMode": {
              "type": "string",
              "enum": [
                "open",
                "recent"
              ]
            },
            "search": {
              "type": "string",
              "maxLength": 200
            }
          },
          "required": [
            "type",
            "name",
            "queue",
            "viewMode",
            "search"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "required": [
    "productId",
    "request"
  ],
  "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"
          }
        }
      ]
    }
  }
}
JSON
Schéma complet de la réponse
JSON
{
  "$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"
          }
        }
      ]
    }
  }
}
JSON

Refus et reprise

Les statuts documentés pour cette opération sont 400, 401, 402, 403, 404, 409, 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
JSON
{
  "description": "Requires a dedicated API OAuth bearer for audience /api/v1 and api:connect, the named support scope, current organization/product consent and native human permissions. Cookies, organization keys and tokens issued to the MCP audience are not accepted. Entitlement, billing write access and per-admission API metering apply. No human sender is synthesized. Draft saving is private and never sends a reply. expectedRevision is native draft CAS; after a lost response read current draft state rather than blindly repeating a stale revision. Saved-view creation is not replay-safe. Human takeover and return-to-AI use immutable receipts with exact keys and conversation revisions."
}
JSON