{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/shipcloud/json-schema/shipcloud-webhook-object-with-id-schema.json",
  "title": "webhook_object_with_id",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/shipcloud-webhooks-api-openapi.yml#/components/schemas/webhook_object_with_id",
  "allOf": [
    {
      "$ref": "#/$defs/webhook_object"
    },
    {
      "properties": {
        "id": {
          "type": "string",
          "description": "the webhook id that can be used for requesting info about a webhook"
        },
        "deactivated": {
          "type": "boolean",
          "description": "set to true, if the call of the webhook URL fails ten times."
        }
      },
      "required": [
        "id"
      ]
    }
  ],
  "$defs": {
    "webhook_event_types": {
      "description": "the event types that a webhook can have",
      "type": "string",
      "enum": [
        "*",
        "shipment.*",
        "shipment.status.*",
        "shipment.status.deleted",
        "shipment.tracking.*",
        "shipment.tracking.awaits_pickup_by_receiver",
        "shipment.tracking.canceled",
        "shipment.tracking.delayed",
        "shipment.tracking.delivered",
        "shipment.tracking.destroyed",
        "shipment.tracking.exception",
        "shipment.tracking.label_created",
        "shipment.tracking.not_delivered",
        "shipment.tracking.notification",
        "shipment.tracking.out_for_delivery",
        "shipment.tracking.picked_up",
        "shipment.tracking.transit",
        "shipment.tracking.unknown"
      ]
    },
    "webhook_object": {
      "type": "object",
      "description": "Webhooks inform your system of events that have happened within the shipcloud platform",
      "properties": {
        "url": {
          "type": "string",
          "description": "The URL that the webhook should call"
        },
        "event_types": {
          "type": "array",
          "description": "Events this webhook should subscribe to",
          "items": {
            "$ref": "#/$defs/webhook_event_types"
          }
        },
        "security": {
          "type": "object",
          "description": "Security object to hold data for securing the webhook",
          "properties": {
            "type": {
              "type": "string",
              "description": "Type of authorization",
              "enum": [
                "basic_auth"
              ]
            }
          }
        }
      },
      "required": [
        "url",
        "event_types"
      ]
    }
  }
}