{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/lucca/json-schema/lucca-webhook-endpoints-read-schema.json",
  "title": "webhook-endpoints.read",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lucca-webhooks-api-openapi.yml#/components/schemas/webhook-endpoints.read",
  "allOf": [
    {
      "$ref": "#/$defs/webhook-endpoints"
    },
    {
      "$ref": "#/$defs/webhook-endpoint.embedded"
    }
  ],
  "$defs": {
    "business-establishment-reference": {
      "title": "business-establishment-reference",
      "description": "Reference to a [business-establishment](../organization/business-establishment) resource.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "type": {
          "type": "string",
          "const": "business-establishment"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "collection.links": {
      "type": "object",
      "properties": {
        "links": {
          "title": "Links",
          "description": "Links to related resources",
          "type": [
            "object",
            "null"
          ],
          "required": [
            "prev",
            "next"
          ],
          "properties": {
            "prev": {
              "description": "Link to the previous page, or `null` when there is none.\nIt may be set on the first page, and then leads to an empty page.",
              "allOf": [
                {
                  "$ref": "#/$defs/page-link"
                }
              ]
            },
            "next": {
              "description": "Link to the next page, or `null` when there is none: stop paging when `next` is `null`.\nIt may be set on the last page when that page is full, and then leads to an empty page whose `next` is `null`.",
              "allOf": [
                {
                  "$ref": "#/$defs/page-link"
                }
              ]
            }
          }
        }
      }
    },
    "createdAt": {
      "title": "createdAt",
      "description": "**Read-only.** UTC timestamp of the moment this object was created.\nThe UTC offset may be written `Z` or `+00:00`, with up to 7 fractional digits of a second.",
      "type": "string",
      "format": "date-time"
    },
    "lastUpdatedAt": {
      "title": "lastUpdatedAt",
      "description": "**Read-only.** UTC timestamp of the moment this object was last updated.\nSet upon creation, update or deletion of the object.\nThe UTC offset may be written `Z` or `+00:00`, with up to 7 fractional digits of a second.",
      "type": "string",
      "format": "date-time"
    },
    "page-link": {
      "title": "page-link",
      "description": "Link to another page of a collection.",
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": false,
      "properties": {
        "href": {
          "type": "string",
          "format": "uri",
          "description": "URL of the page."
        }
      },
      "required": [
        "href"
      ]
    },
    "webhook-endpoint": {
      "title": "webhook-endpoint",
      "x-tags": [
        "Webhooks"
      ],
      "description": "A webhook-endpoint describes the endpoint on your side that will receive events from your Lucca account.\n\nIt must handle HTTPS and support POST requests.\n\nIt should always check the signature of received events in order to increase security.\n\nIt should respond as fast as possible (less than 3s), otherwise the server may stop sending it events.\n\nPlease refer to the [webhooks documentation](/documentation/webhooks) to learn more about webhook-endpoints.",
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "type": {
          "type": "string",
          "const": "webhook-endpoint"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "apiVersion": {
          "type": "string",
          "format": "date"
        },
        "webhookUrl": {
          "type": "string",
          "format": "uri",
          "description": "URL of the receiving endpoint on your side. MUST use the `https://` schema."
        },
        "topics": {
          "type": "array",
          "description": "See complete [list of all topics](../events/event) in the event definition.",
          "items": {
            "type": "string"
          }
        },
        "businessEstablishments": {
          "description": "Restrict events to those belonging to one of the given business-establishments. `null` should be interpreted as \"all business establishments\".",
          "type": [
            "null",
            "array"
          ],
          "uniqueItems": true,
          "minItems": 1,
          "items": {
            "$ref": "#/$defs/business-establishment-reference"
          }
        },
        "status": {
          "description": "'active': delivery attempts will be executed.\n'suspended': if too many errors are encountered on delivery. Events are kept in history.\n'inactive': events are neither sent nor kept in history.",
          "type": "string",
          "enum": [
            "active",
            "suspended",
            "inactive"
          ],
          "x-enumDescriptions": {
            "active": "Events will be delivered.",
            "suspended": "Events are not be delivered but are kept in history.",
            "inactive": "Events are neither sent nor kept in history."
          },
          "default": "inactive"
        },
        "createdAt": {
          "$ref": "#/$defs/createdAt"
        },
        "lastUpdatedAt": {
          "$ref": "#/$defs/lastUpdatedAt"
        },
        "links": {
          "type": [
            "object",
            "null"
          ]
        }
      }
    },
    "webhook-endpoint.embedded": {
      "type": "object",
      "properties": {
        "embedded": {
          "description": "No embedded resources on a webhook-endpoint(s) response. Expect an empty object if embedded are requested.",
          "type": [
            "object",
            "null"
          ]
        }
      }
    },
    "webhook-endpoints": {
      "title": "webhook-endpoints",
      "description": "A collection of webhook-endpoint objects.",
      "allOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "webhook-endpoints"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "totalCount": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int64",
              "minimum": 0,
              "description": "Total number of webhook-endpoint resources across all pages that satisfy query parameters."
            },
            "items": {
              "type": "array",
              "minItems": 0,
              "maxItems": 100,
              "description": "Paginated list of webhook-endpoint resources.",
              "items": {
                "$ref": "#/$defs/webhook-endpoint"
              }
            }
          }
        },
        {
          "$ref": "#/$defs/collection.links"
        }
      ]
    }
  }
}