{
  "asyncapi": "3.0.0",
  "id": "https://arcenciel.io/developers/asyncapi/1.0.0.json",
  "info": {
    "title": "Arc en Ciel Developer Webhooks",
    "version": "1.0.0",
    "description": "Versioned, owner-scoped, at-least-once event deliveries. Receivers must verify the HMAC signature over timestamp.rawBody and deduplicate by event id.",
    "externalDocs": {
      "description": "Webhook setup, verification, retries, and signature guide",
      "url": "https://arcenciel.io/developers#webhooks"
    }
  },
  "defaultContentType": "application/json",
  "servers": {
    "receiver": {
      "host": "developer-defined.example",
      "pathname": "/webhooks/arcenciel",
      "protocol": "https",
      "description": "The verified HTTPS port-443 receiver URL registered by the developer."
    }
  },
  "channels": {
    "developerEndpoint": {
      "address": "/webhooks/arcenciel",
      "description": "One verified developer-owned receiver. Delivery is at least once and ordering is not guaranteed.",
      "messages": {
        "modelPublished": { "$ref": "#/components/messages/modelPublished" },
        "articlePublished": { "$ref": "#/components/messages/articlePublished" },
        "feedbackStatusChanged": { "$ref": "#/components/messages/feedbackStatusChanged" }
      }
    }
  },
  "operations": {
    "receiveModelPublished": {
      "action": "receive",
      "channel": { "$ref": "#/channels/developerEndpoint" },
      "messages": [{ "$ref": "#/channels/developerEndpoint/messages/modelPublished" }]
    },
    "receiveArticlePublished": {
      "action": "receive",
      "channel": { "$ref": "#/channels/developerEndpoint" },
      "messages": [{ "$ref": "#/channels/developerEndpoint/messages/articlePublished" }]
    },
    "receiveFeedbackStatusChanged": {
      "action": "receive",
      "channel": { "$ref": "#/channels/developerEndpoint" },
      "messages": [{ "$ref": "#/channels/developerEndpoint/messages/feedbackStatusChanged" }]
    }
  },
  "components": {
    "messages": {
      "modelPublished": {
        "name": "model.published",
        "title": "Model published",
        "summary": "A model owned by the endpoint owner became publicly available.",
        "headers": { "$ref": "#/components/schemas/deliveryHeaders" },
        "payload": { "$ref": "#/components/schemas/modelPublishedEnvelope" },
        "examples": [{ "name": "model", "payload": { "id": "evt_57d188eb4444469eaf32e6707f8f13b7", "type": "model.published", "version": "1", "createdAt": "2026-08-08T00:00:00.000Z", "livemode": true, "data": { "object": { "id": 123, "type": "model", "title": "Example model", "status": "PUBLISHED", "publishedAt": "2026-08-08T00:00:00.000Z" }, "resourceUrl": "https://arcenciel.io/models/123" } } }]
      },
      "articlePublished": {
        "name": "article.published",
        "title": "Article published",
        "summary": "An article owned by the endpoint owner became publicly available.",
        "headers": { "$ref": "#/components/schemas/deliveryHeaders" },
        "payload": { "$ref": "#/components/schemas/articlePublishedEnvelope" },
        "examples": [{ "name": "article", "payload": { "id": "evt_4738666174014cad8409ec43c17cd85f", "type": "article.published", "version": "1", "createdAt": "2026-08-08T00:00:00.000Z", "livemode": true, "data": { "object": { "id": 321, "type": "article", "title": "Example article", "status": "PUBLISHED", "updatedAt": "2026-08-08T00:00:00.000Z" }, "resourceUrl": "https://arcenciel.io/articles/321" } } }]
      },
      "feedbackStatusChanged": {
        "name": "feedback.status_changed",
        "title": "Feedback status changed",
        "summary": "A feedback case submitted by the endpoint owner changed status.",
        "headers": { "$ref": "#/components/schemas/deliveryHeaders" },
        "payload": { "$ref": "#/components/schemas/feedbackStatusChangedEnvelope" },
        "examples": [{ "name": "feedback", "payload": { "id": "evt_d4f8dbe4e2474ce6a01e53ca33d6edb3", "type": "feedback.status_changed", "version": "1", "createdAt": "2026-08-08T00:00:00.000Z", "livemode": true, "data": { "object": { "id": "fb_01J4V8S8F5D0", "type": "feedback", "status": "RESOLVED", "updatedAt": "2026-08-08T00:00:00.000Z" }, "resourceUrl": "https://arcenciel.io/feedback/fb_01J4V8S8F5D0" } } }]
      }
    },
    "schemas": {
      "deliveryHeaders": {
        "type": "object",
        "required": ["X-AEC-Event", "X-AEC-Event-Version", "X-AEC-Event-Id", "X-AEC-Delivery-Id", "X-AEC-Timestamp", "X-AEC-Signature"],
        "properties": {
          "X-AEC-Event": { "type": "string" },
          "X-AEC-Event-Version": { "type": "string", "const": "1" },
          "X-AEC-Event-Id": { "type": "string", "pattern": "^evt_" },
          "X-AEC-Delivery-Id": { "type": "string", "pattern": "^dly_" },
          "X-AEC-Timestamp": { "type": "string", "pattern": "^[0-9]+$" },
          "X-AEC-Signature": { "type": "string", "pattern": "^t=[0-9]+,v1=[a-f0-9]{64}" }
        }
      },
      "baseEnvelope": {
        "type": "object",
        "required": ["id", "type", "version", "createdAt", "livemode", "data"],
        "properties": {
          "id": { "type": "string", "pattern": "^evt_" },
          "type": { "type": "string" },
          "version": { "type": "string", "const": "1" },
          "createdAt": { "type": "string", "format": "date-time" },
          "livemode": { "type": "boolean" },
          "data": {
            "type": "object",
            "required": ["object", "resourceUrl"],
            "properties": {
              "object": { "type": "object" },
              "resourceUrl": { "type": "string", "format": "uri" }
            }
          }
        }
      },
      "modelPublishedEnvelope": {
        "allOf": [
          { "$ref": "#/components/schemas/baseEnvelope" },
          { "type": "object", "properties": { "type": { "const": "model.published" }, "data": { "type": "object", "properties": { "object": { "$ref": "#/components/schemas/modelObject" } } } } }
        ]
      },
      "articlePublishedEnvelope": {
        "allOf": [
          { "$ref": "#/components/schemas/baseEnvelope" },
          { "type": "object", "properties": { "type": { "const": "article.published" }, "data": { "type": "object", "properties": { "object": { "$ref": "#/components/schemas/articleObject" } } } } }
        ]
      },
      "feedbackStatusChangedEnvelope": {
        "allOf": [
          { "$ref": "#/components/schemas/baseEnvelope" },
          { "type": "object", "properties": { "type": { "const": "feedback.status_changed" }, "data": { "type": "object", "properties": { "object": { "$ref": "#/components/schemas/feedbackObject" } } } } }
        ]
      },
      "modelObject": {
        "type": "object",
        "required": ["id", "type", "title", "status"],
        "properties": { "id": { "type": "integer" }, "type": { "const": "model" }, "title": { "type": "string" }, "status": { "type": "string" }, "publishedAt": { "type": ["string", "null"], "format": "date-time" } }
      },
      "articleObject": {
        "type": "object",
        "required": ["id", "type", "title", "status"],
        "properties": { "id": { "type": "integer" }, "type": { "const": "article" }, "title": { "type": "string" }, "status": { "type": "string" }, "updatedAt": { "type": ["string", "null"], "format": "date-time" } }
      },
      "feedbackObject": {
        "type": "object",
        "required": ["id", "type", "status"],
        "properties": { "id": { "type": "string" }, "type": { "const": "feedback" }, "status": { "type": "string" }, "updatedAt": { "type": ["string", "null"], "format": "date-time" } }
      }
    }
  }
}
