{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/getsmileapi/main/json-schema/getsmileapi-webhook-post-request-schema.json",
  "title": "WebhookPostRequest",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/getsmileapi-smile-api-openapi.yml#/components/schemas/WebhookPostRequest",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Name of the webhook endpoint"
    },
    "url": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500,
      "description": "URL of webhook, must begin with https://"
    },
    "eventTypes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RefWebhookEventType"
      }
    },
    "active": {
      "type": "boolean",
      "description": "Whether to set this webhook active to received events"
    },
    "includePayload": {
      "type": "boolean",
      "default": false,
      "description": "Whether to put all datapoints' payload into the events(TASK_FINISHED, ACCOUNT_SNYC_TASK_FINISHED)"
    },
    "secret": {
      "type": "string",
      "description": "The key that will be used to generate HMAC-SHA512 hex digest value in the Smile-Signature header.",
      "minLength": 1,
      "maxLength": 64
    }
  },
  "required": [
    "name",
    "url",
    "eventTypes",
    "active",
    "secret"
  ],
  "$defs": {
    "RefWebhookEventType": {
      "title": "RefWebhookEventType",
      "description": "Event Type which will be sent as a notification via webhook",
      "type": "string",
      "enum": [
        "USER_CREATED",
        "ACCOUNT_CREATED",
        "ACCOUNT_CONNECTED",
        "ACCOUNT_DISCONNECTED",
        "ACCOUNT_FAILED",
        "TASK_STARTED",
        "TASK_FINISHED",
        "ACCOUNT_SYNC_TASK_FINISHED",
        "ARCHIVE_STARTED",
        "ARCHIVE_ANALYZED",
        "ARCHIVE_REVOKED",
        "ARCHIVE_FAILED",
        "INVITE_INVITED",
        "INVITE_LINKED",
        "IDENTITY_ADDED",
        "RATING_ADDED",
        "TRANSACTIONS_ADDED",
        "DOCUMENTS_ADDED",
        "DOCUMENTS_UPDATED",
        "EMPLOYMENTS_ADDED",
        "EMPLOYMENTS_UPDATED",
        "INCOMES_ADDED",
        "INCOMES_UPDATED",
        "CONTRIBUTIONS_ADDED",
        "CONTRIBUTIONS_UPDATED",
        "EINCOMES_ADDED",
        "EINCOMES_UPDATED",
        "LIABILITIES_ADDED",
        "LIABILITIES_UPDATED",
        "INSIGHT_ADDED",
        "LINK_ADDED",
        "VERIFICATION_STARTED",
        "VERIFICATION_COMPLETED",
        "RECORD_CREATED",
        "RECORD_COMPLETED",
        "USER_SESSION_COMPLETED",
        "USER_SESSION_RESET",
        "ALL_EVENTS"
      ]
    }
  }
}