POST · Exécuter une opération

Intégrations : Exécuter une opération. Paramètres, accès et exemples de réponse.

Rédigé par Red Blue

Mis à jour le

Intégrations

POST /api/v1/integrations/execute

operationId : integrations_execute

Accès

Permission

Consentements OAuth

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

integration.execute

api:connect, integration:execute

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 ; Longueur maximale : 200

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

"sync"

connectionId, expectedRevision

request.operation

"replay"

deliveryId, expectedRevision

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/integrations/execute" \
  --header "Authorization: Bearer $KHONY_ACCESS_TOKEN" \
  --header 'Idempotency-Key: 0198f886-9f71-7000-8000-000000000010' \
  --header 'X-Khony-Confirmation: 0198f886-9f71-7000-8000-000000000011' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "productId": "product_01k3w8d7vhe008000000000001",
  "request": {
    "operation": "replay",
    "deliveryId": "webhook_delivery_01k3w8d7vhe008000000000004",
    "expectedRevision": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  }
}'
Shell

Réponse de succès · HTTP 200

JSON
{
  "operation": "replay",
  "accepted": true,
  "resource": {
    "id": "webhook_delivery_01k3w8d7vhe008000000000004",
    "subscriptionId": "webhook_subscription_01k3w8d7vhe008000000000003",
    "eventType": "feedback.created",
    "status": "retrying",
    "attemptCount": 1,
    "nextAttemptAt": "2026-10-23T10:00:00.000Z",
    "deliveredAt": null,
    "createdAt": "2026-10-23T10:00:00.000Z",
    "updatedAt": "2026-10-23T10:00:00.000Z",
    "revision": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
  }
}
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": "sync"
            },
            "connectionId": {
              "type": "string",
              "pattern": "^integration_connection_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
            },
            "expectedRevision": {
              "$ref": "#/$defs/__schema0"
            }
          },
          "required": [
            "operation",
            "connectionId",
            "expectedRevision"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "replay"
            },
            "deliveryId": {
              "type": "string",
              "pattern": "^webhook_delivery_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
            },
            "expectedRevision": {
              "$ref": "#/$defs/__schema0"
            }
          },
          "required": [
            "operation",
            "deliveryId",
            "expectedRevision"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "required": [
    "productId",
    "request"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    }
  }
}
JSON
Schéma complet de la réponse
JSON
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "operation": {
      "type": "string",
      "enum": [
        "disconnect",
        "disable",
        "resume",
        "health",
        "sync",
        "replay"
      ]
    },
    "accepted": {
      "type": "boolean",
      "const": true
    },
    "resource": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^integration_connection_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
            },
            "provider": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "authStrategy": {
              "type": "string"
            },
            "healthy": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "configurationRevision": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "lastSyncedAt": {
              "$ref": "#/$defs/__schema0"
            },
            "lastSuccessfulRequestAt": {
              "$ref": "#/$defs/__schema0"
            },
            "lastFailedRequestAt": {
              "$ref": "#/$defs/__schema0"
            },
            "lastWebhookAt": {
              "$ref": "#/$defs/__schema0"
            },
            "updatedAt": {
              "$ref": "#/$defs/__schema1"
            },
            "revision": {
              "$ref": "#/$defs/__schema2"
            }
          },
          "required": [
            "id",
            "provider",
            "status",
            "authStrategy",
            "healthy",
            "configurationRevision",
            "lastSyncedAt",
            "lastSuccessfulRequestAt",
            "lastFailedRequestAt",
            "lastWebhookAt",
            "updatedAt",
            "revision"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "$ref": "#/$defs/__schema3"
            },
            "name": {
              "type": "string"
            },
            "endpointOrigin": {
              "type": "string"
            },
            "eventPatterns": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "status": {
              "type": "string"
            },
            "disabledAt": {
              "$ref": "#/$defs/__schema0"
            },
            "createdAt": {
              "$ref": "#/$defs/__schema1"
            },
            "updatedAt": {
              "$ref": "#/$defs/__schema1"
            },
            "revision": {
              "$ref": "#/$defs/__schema2"
            }
          },
          "required": [
            "id",
            "name",
            "endpointOrigin",
            "eventPatterns",
            "status",
            "disabledAt",
            "createdAt",
            "updatedAt",
            "revision"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^webhook_delivery_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
            },
            "subscriptionId": {
              "$ref": "#/$defs/__schema3"
            },
            "eventType": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "attemptCount": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "nextAttemptAt": {
              "$ref": "#/$defs/__schema1"
            },
            "deliveredAt": {
              "$ref": "#/$defs/__schema0"
            },
            "createdAt": {
              "$ref": "#/$defs/__schema1"
            },
            "updatedAt": {
              "$ref": "#/$defs/__schema1"
            },
            "revision": {
              "$ref": "#/$defs/__schema2"
            }
          },
          "required": [
            "id",
            "subscriptionId",
            "eventType",
            "status",
            "attemptCount",
            "nextAttemptAt",
            "deliveredAt",
            "createdAt",
            "updatedAt",
            "revision"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "required": [
    "operation",
    "accepted",
    "resource"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "anyOf": [
        {
          "$ref": "#/$defs/__schema1"
        },
        {
          "type": "null"
        }
      ]
    },
    "__schema1": {
      "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))$"
    },
    "__schema2": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "__schema3": {
      "type": "string",
      "pattern": "^webhook_subscription_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
    }
  }
}
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": "The selected product must belong to the authenticated organization. Uses shared API admission, billing meter and public API entitlement. Projections exclude credentials, raw configuration, provider cursors, event payloads and remote response bodies. Outbound webhook views/effects additionally require the webhooks entitlement. A dedicated API OAuth bearer with api:connect and the operation scope, a current administrator session and consented product are required. API keys and browser cookies cannot mutate. Sensitive commands require server-owned human confirmation; no model-provided boolean is accepted. Supply a stable Idempotency-Key and the exact expectedRevision returned by a current read. An identical retry returns the receipt without reapplying the effect, after current authorization. sync uses native source eligibility and outbox. replay only accepts a terminal failed/succeeded delivery belonging to an active subscription. accepted means durable enqueue, not remote success. Inspect history for completion. Retries do not enqueue twice. Incoming signed provider events cannot be manufactured through this endpoint."
}
JSON