{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/akahu/main/json-schema/akahu-webhook-event-schema.json",
  "title": "WebhookEvent",
  "x-generated": "2026-10-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/akahu-webhooks-api-openapi.yml#/components/schemas/WebhookEvent",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "Unique Akahu webhook event identifier."
    },
    "hook": {
      "type": "string",
      "description": "Unique Akahu webhook identifier."
    },
    "status": {
      "type": "string",
      "enum": [
        "SENT",
        "RETRY",
        "FAILED"
      ],
      "description": "Webhook event state\n- `SENT` Webhook has been sent and has been confirmed with a `200` response from the receiver.\n\n- `RETRY` Webhook has failed to send in a previous attempt but it will be retried.\n\n- `FAILED` Webhook has failed to send after attempted retries, due to not receiving a `200` response from the receiver."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 formatted timestamp that the webhook event was created."
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 formatted timestamp that the webhook event was last updated."
    },
    "last_failed_at": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 formatted timestamp that the webhook event last failed."
    },
    "payload": {
      "type": "object",
      "description": "payload / event body sent to the `_hook`",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "webhook_type": {
          "type": "string",
          "enum": [
            "TOKEN",
            "ACCOUNT",
            "TRANSACTION",
            "PAYMENT",
            "TRANSFER"
          ],
          "description": "Resource the webhook event is related to for more details checkout the [📖 Webhooks reference](/docs/reference-webhooks)"
        },
        "webhook_code": {
          "type": "string",
          "description": "Webhook action dependant on the `webhook_type` for more details on our provided webhooks checkout the [📖 Webhooks reference](/docs/reference-webhooks)"
        }
      }
    }
  }
}