POST · Diagnostiquer

Intégrations : Diagnostiquer. Paramètres, accès et exemples de réponse.

Rédigé par Red Blue

Mis à jour le

Intégrations

POST /api/v1/integrations/health

operationId : integrations_health

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.

Champs du corps JSON

Nom

Emplacement

Requis

Type et contraintes

productId

JSON

Oui

string

request

JSON

Oui

object

Exemple de requête

Shell
curl --request POST "$KHONY_ORIGIN/api/v1/integrations/health" \
  --header "Authorization: Bearer $KHONY_ACCESS_TOKEN" \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "productId": "product_01k3w8d7vhe008000000000001",
  "request": {
    "operation": "health",
    "connectionId": "integration_connection_01k3w8d7vhe008000000000002",
    "expectedRevision": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  }
}'
Shell

Réponse de succès · HTTP 200

JSON
{
  "operation": "health",
  "accepted": true,
  "resource": {
    "id": "integration_connection_01k3w8d7vhe008000000000002",
    "provider": "mixpanel",
    "status": "active",
    "authStrategy": "api_key",
    "healthy": true,
    "configurationRevision": 0,
    "lastSyncedAt": null,
    "lastSuccessfulRequestAt": "2026-10-23T10:00:00.000Z",
    "lastFailedRequestAt": null,
    "lastWebhookAt": null,
    "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": {
      "type": "object",
      "properties": {
        "operation": {
          "type": "string",
          "const": "health"
        },
        "connectionId": {
          "type": "string",
          "pattern": "^integration_connection_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
        },
        "expectedRevision": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        }
      },
      "required": [
        "operation",
        "connectionId",
        "expectedRevision"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "productId",
    "request"
  ],
  "additionalProperties": false
}
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. Requires delegated API OAuth api:connect and integration:execute, current administrator access, write billing admission and expectedRevision. Calls the existing provider health lifecycle, including native credential refresh when applicable. This remote request has no transactional exactly-once receipt; no automatic retry is performed. Inspect the current connection after uncertainty. Reconnection and credentials remain native. No raw provider response is returned."
}
JSON