POST · Lire un Copilot hérité

Conversations : Lire un Copilot hérité. Paramètres, accès et exemples de réponse.

Rédigé par Red Blue

Mis à jour le

Conversations

POST /api/v1/inbox/copilot-read

operationId : inbox_copilot_read

Accès

Permission

Consentements OAuth

OAuth : délégation d’un équipier pour l’API

support.read

api:connect, support:read

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

"chat"

conversationId

request.operation

"proposal_preview"

conversationId, messageId, draftIdentity

request.operation

"source"

conversationId, messageId, sourceId

request.operation

["command_get","review_get"]

conversationId, commandId

request.operation

"command_list"

conversationId

request.operation

"activity"

conversationId

request.operation

"observation"

conversationId, messageId, surface

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/copilot-read" \
  --header "Authorization: Bearer $KHONY_ACCESS_TOKEN" \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "productId": "product_01k3w8d7vhe008000000000001",
  "request": {
    "operation": "chat",
    "conversationId": "support_conversation_01k3w8d7vhe008000000000002"
  }
}'
Shell

Réponse de succès · HTTP 200

JSON
{
  "data": []
}
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": {
            "operation": {
              "type": "string",
              "const": "chat"
            },
            "conversationId": {
              "$ref": "#/$defs/__schema0"
            }
          },
          "required": [
            "operation",
            "conversationId"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "proposal_preview"
            },
            "conversationId": {
              "$ref": "#/$defs/__schema0"
            },
            "messageId": {
              "type": "string",
              "pattern": "^support_copilot_message_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
            },
            "draftIdentity": {
              "type": "string",
              "maxLength": 80000
            }
          },
          "required": [
            "operation",
            "conversationId",
            "messageId",
            "draftIdentity"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "source"
            },
            "conversationId": {
              "$ref": "#/$defs/__schema0"
            },
            "messageId": {
              "type": "string",
              "pattern": "^support_copilot_message_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
            },
            "sourceId": {
              "type": "string",
              "maxLength": 300
            }
          },
          "required": [
            "operation",
            "conversationId",
            "messageId",
            "sourceId"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "enum": [
                "command_get",
                "review_get"
              ]
            },
            "conversationId": {
              "$ref": "#/$defs/__schema0"
            },
            "commandId": {
              "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)$"
            }
          },
          "required": [
            "operation",
            "conversationId",
            "commandId"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "command_list"
            },
            "conversationId": {
              "$ref": "#/$defs/__schema0"
            }
          },
          "required": [
            "operation",
            "conversationId"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "activity"
            },
            "conversationId": {
              "$ref": "#/$defs/__schema0"
            },
            "cursor": {
              "type": "object",
              "properties": {
                "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))$"
                },
                "turnId": {
                  "type": "string",
                  "maxLength": 200
                }
              },
              "required": [
                "createdAt",
                "turnId"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "operation",
            "conversationId"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "observation"
            },
            "conversationId": {
              "$ref": "#/$defs/__schema0"
            },
            "messageId": {
              "type": "string",
              "pattern": "^support_message_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
            },
            "surface": {
              "type": "string",
              "enum": [
                "support_copilot",
                "customer_agent"
              ]
            }
          },
          "required": [
            "operation",
            "conversationId",
            "messageId",
            "surface"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "required": [
    "productId",
    "request"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "type": "string",
      "pattern": "^support_conversation_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
    }
  }
}
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, 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 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 Knowledge permissions, source provenance, conversation visibility and private ownership still apply. Chats, proposals, command receipts and AI observations are not customer content."
}
JSON