POST · Catalogue Support
Rédigé par Red Blue
Mis à jour le
POST /api/v1/inbox/queries
operationId : inbox_catalog_query
Accès | Permission | Consentements OAuth |
|---|---|---|
Clé API d’organisation | supportAutomation.read | 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.
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.view | "context" | conversationId, context |
request.view | "teams" | Aucun autre champ imposé |
request.view | "members" | Aucun autre champ imposé |
request.view | "team_members" | teamId |
request.view | "tags" | Aucun autre champ imposé |
request.view | "counts" | Aucun autre champ imposé |
request.view | "events" | conversationId |
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/queries" \
--header "x-api-key: $KHONY_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"productId": "product_01k3w8d7vhe008000000000001",
"request": {
"view": "teams",
"limit": 20
}
}'Réponse de succès · HTTP 200
{
"view": "teams",
"data": [
{
"id": "support_team_01k3w8d7vhe008000000000005",
"name": "Customer support"
}
],
"nextCursor": null
}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": [
{
"type": "object",
"properties": {
"view": {
"type": "string",
"const": "context"
},
"conversationId": {
"type": "string",
"pattern": "^support_conversation_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"context": {
"type": "string",
"enum": [
"customer",
"companies",
"person_fields",
"recent_conversations",
"feedback_journey",
"satisfaction",
"sla",
"participants",
"ai_proposals",
"tags",
"linked_feedback"
]
},
"limit": {
"default": 20,
"type": "integer",
"minimum": 1,
"maximum": 50
},
"cursor": {
"type": "string",
"maxLength": 300
}
},
"required": [
"view",
"conversationId",
"context"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"view": {
"type": "string",
"const": "teams"
},
"limit": {
"$ref": "#/$defs/__schema0"
},
"cursor": {
"type": "string",
"pattern": "^support_team_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
}
},
"required": [
"view"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"view": {
"type": "string",
"const": "members"
},
"limit": {
"$ref": "#/$defs/__schema0"
},
"cursor": {
"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": [
"view"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"view": {
"type": "string",
"const": "team_members"
},
"teamId": {
"type": "string",
"pattern": "^support_team_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"limit": {
"$ref": "#/$defs/__schema0"
},
"cursor": {
"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": [
"view",
"teamId"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"view": {
"type": "string",
"const": "tags"
},
"query": {
"default": "",
"type": "string",
"maxLength": 100
}
},
"required": [
"view"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"view": {
"type": "string",
"const": "counts"
}
},
"required": [
"view"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"view": {
"type": "string",
"const": "events"
},
"conversationId": {
"type": "string",
"pattern": "^support_conversation_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"limit": {
"$ref": "#/$defs/__schema0"
},
"before": {
"type": "string",
"pattern": "^support_conversation_event_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
}
},
"required": [
"view",
"conversationId"
],
"additionalProperties": false
}
]
}
},
"required": [
"productId",
"request"
],
"additionalProperties": false,
"$defs": {
"__schema0": {
"default": 20,
"type": "integer",
"minimum": 1,
"maximum": 50
}
}
}Schéma complet de la réponse
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"type": "object",
"properties": {
"view": {
"type": "string",
"const": "context"
},
"context": {
"type": "string"
},
"data": {
"$ref": "#/$defs/__schema0"
},
"nextCursor": {
"type": [
"string",
"null"
]
}
},
"required": [
"view",
"context",
"data",
"nextCursor"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"view": {
"type": "string",
"const": "teams"
},
"data": {
"maxItems": 50,
"type": "array",
"items": {
"$ref": "#/$defs/__schema1"
}
},
"nextCursor": {
"anyOf": [
{
"type": "string",
"pattern": "^support_team_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
{
"type": "null"
}
]
}
},
"required": [
"view",
"data",
"nextCursor"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"view": {
"type": "string",
"enum": [
"members",
"team_members"
]
},
"data": {
"maxItems": 50,
"type": "array",
"items": {
"$ref": "#/$defs/__schema2"
}
},
"nextCursor": {
"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": [
"view",
"data",
"nextCursor"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"view": {
"type": "string",
"const": "tags"
},
"data": {
"maxItems": 30,
"type": "array",
"items": {
"$ref": "#/$defs/__schema3"
}
},
"nextCursor": {
"type": "null"
}
},
"required": [
"view",
"data",
"nextCursor"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"view": {
"type": "string",
"const": "counts"
},
"data": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "number"
}
},
"nextCursor": {
"type": "null"
}
},
"required": [
"view",
"data",
"nextCursor"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"view": {
"type": "string",
"const": "events"
},
"data": {
"maxItems": 50,
"type": "array",
"items": {
"$ref": "#/$defs/__schema4"
}
},
"nextCursor": {
"anyOf": [
{
"type": "string",
"pattern": "^support_conversation_event_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
{
"type": "null"
}
]
}
},
"required": [
"view",
"data",
"nextCursor"
],
"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"
}
}
]
},
"__schema1": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^support_team_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"name": {
"type": "string"
}
},
"required": [
"id",
"name"
],
"additionalProperties": false
},
"__schema2": {
"type": "object",
"properties": {
"userId": {
"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)$"
},
"name": {
"type": "string"
},
"email": {
"type": "string"
}
},
"required": [
"userId",
"name",
"email"
],
"additionalProperties": false
},
"__schema3": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^tag_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"name": {
"type": "string"
},
"color": {
"type": "string"
}
},
"required": [
"id",
"name",
"color"
],
"additionalProperties": false
},
"__schema4": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^support_conversation_event_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"type": {
"type": "string"
},
"occurredAt": {
"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))$"
},
"actorUserId": {
"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"
}
]
},
"actorPrincipalKey": {
"type": [
"string",
"null"
]
},
"fromStatus": {
"type": [
"string",
"null"
]
},
"toStatus": {
"type": [
"string",
"null"
]
},
"fromResponderMode": {
"type": [
"string",
"null"
]
},
"toResponderMode": {
"type": [
"string",
"null"
]
}
},
"required": [
"id",
"type",
"occurredAt",
"actorUserId",
"actorPrincipalKey",
"fromStatus",
"toStatus",
"fromResponderMode",
"toResponderMode"
],
"additionalProperties": false
}
}
}Refus et reprise
Les statuts documentés pour cette opération sont 400, 401, 402, 403, 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": "New explicit support-reader/editor organization profile required; legacy support.read grants do not qualify. Organization-wide visibility includes restricted conversations, customer identities and internal notes. Private human resources require their separately delegated OAuth endpoints. Native tenant, role, billing and per-admission API meter checks apply. Bounded teams, members, tags, counts, conversation events and explicit context projections. Internal command-receipt payloads are never returned through audit events. Context collections are live offset pages; tags search retains the native 30-result cap. Key counts omit the human mine queue."
}