{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/atlar/json-schema/atlar-webhook-schema.json",
  "title": "Webhook",
  "description": "A webhook configuration.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/atlar-webhooks-api-openapi.yml#/components/schemas/Webhook",
  "type": "object",
  "properties": {
    "id": {
      "$ref": "#/$defs/ResourceID"
    },
    "organizationId": {
      "$ref": "#/$defs/OrganizationID"
    },
    "url": {
      "$ref": "#/$defs/WebhookURL"
    },
    "filters": {
      "description": "An inclusive filter to specify which resources and events that you are interested in.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/WebhookFilter"
      },
      "minItems": 1
    },
    "verified": {
      "description": "Webhooks requests won't be sent if the webhook\nconfiguration is not verified (by Atlar). Modifying the\nURL sets verified to false. You can contact\n[support@atlar.com](mailto:support@atlar.com) to get a\nwebhook configuration verified.\n",
      "type": "boolean",
      "readOnly": true
    },
    "alias": {
      "description": "A human-readable name for the webhook.",
      "type": "string",
      "maxLength": 100
    },
    "created": {
      "$ref": "#/$defs/CreatedTimestamp"
    },
    "updated": {
      "$ref": "#/$defs/UpdatedTimestamp"
    }
  },
  "required": [
    "id",
    "organizationId",
    "url",
    "filters",
    "verified",
    "created",
    "updated"
  ],
  "$defs": {
    "CreatedTimestamp": {
      "type": "string",
      "format": "date-time",
      "description": "Time at which the resource was created.",
      "readOnly": true
    },
    "EventType": {
      "type": "string",
      "description": "Event type.",
      "enum": [
        "CREATED",
        "UPDATED",
        "DELETED"
      ]
    },
    "OrganizationID": {
      "type": "string",
      "description": "Unique resource identifier for an Organization."
    },
    "ResourceID": {
      "type": "string",
      "description": "Unique resource identifier.",
      "minLength": 32,
      "maxLength": 64
    },
    "UpdatedTimestamp": {
      "type": "string",
      "format": "date-time",
      "description": "Time at which the resource was last updated.",
      "readOnly": true
    },
    "WebhookFilter": {
      "type": "object",
      "properties": {
        "resource": {
          "description": "The API resource for which to receive webhooks. See available\nresources in the [Webhooks and events](https://docs.atlar.com/docs/api#webhooks-and-events) section.\n",
          "type": "string"
        },
        "eventTypes": {
          "description": "A list of event types for which to receive webhooks.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/EventType"
          },
          "minItems": 1
        },
        "apiVersion": {
          "description": "The API version to serialize resources as. E.g. if you are\nconsuming events and do want to deserialize into\n`/payments/v2/credit-transfers`, set `apiVersion: 2`.\n",
          "type": "integer"
        },
        "legacyEventNames": {
          "deprecated": true,
          "description": "API v1 event names. This is only for backwards compatibility with webhooks created via API v1.",
          "type": "array",
          "items": {
            "type": "string"
          },
          "readOnly": true,
          "x-omitempty": true
        }
      },
      "required": [
        "apiVersion",
        "resource",
        "eventTypes"
      ]
    },
    "WebhookURL": {
      "description": "The URL to which webhooks will be sent via HTTP POST requests in JSON format. Must use scheme `https://`.\n",
      "type": "string",
      "minLength": 1,
      "maxLength": 1024,
      "pattern": "^https://"
    }
  }
}