{
  "asyncapi": "3.0.0",
  "info": {
    "title": "Intramedial Async API",
    "version": "0.43.1",
    "description": "Webhook deliveries + SSE streams that complement the REST gateway. Auto-generated from `@intramedial/contracts@0.43.1` on 2026-09-20T00:00:00.000Z.",
    "contact": {
      "name": "Intramedial",
      "url": "https://intramedial.com",
      "email": "support@intramedial.com"
    },
    "license": {
      "name": "Intramedial Terms of Service",
      "url": "https://intramedial.com/terms"
    }
  },
  "servers": {
    "webhooks": {
      "host": "your-endpoint.example.com",
      "protocol": "https",
      "description": "Customer-configured webhook endpoint. We POST signed events here."
    },
    "sse": {
      "host": "api.intramedial.com",
      "protocol": "https",
      "pathname": "/api/v1/streams",
      "description": "Server-Sent Events stream — used for Number One streaming chat, and live audit feed."
    }
  },
  "channels": {
    "webhook-event": {
      "address": "/",
      "messages": {
        "admin_action": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `admin.action`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "admin.action"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "agent_delegation_issued": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `agent.delegation.issued`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "agent.delegation.issued"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "agent_identity_enrolled": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `agent.identity.enrolled`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "agent.identity.enrolled"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "agent_identity_revoked": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `agent.identity.revoked`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "agent.identity.revoked"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "agent_identity_rotated": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `agent.identity.rotated`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "agent.identity.rotated"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "agent_mandate_issued": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `agent.mandate.issued`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "agent.mandate.issued"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "agent_mandate_revoked": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `agent.mandate.revoked`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "agent.mandate.revoked"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "agent_spiffe_bound": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `agent.spiffe.bound`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "agent.spiffe.bound"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "agent_trusted_root_added": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `agent.trusted_root.added`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "agent.trusted_root.added"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "alert_created": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `alert.created`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "alert.created"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "alert_deleted": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `alert.deleted`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "alert.deleted"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "alert_updated": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `alert.updated`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "alert.updated"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "audit_stream_configured": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `audit.stream.configured`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "audit.stream.configured"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "auto_topup_configured": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `auto_topup.configured`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "auto_topup.configured"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "export_completed": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `export.completed`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "export.completed"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "export_requested": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `export.requested`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "export.requested"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "key_issued": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `key.issued`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "key.issued"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "key_revoked": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `key.revoked`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "key.revoked"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "member_invited": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `member.invited`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "member.invited"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "member_joined": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `member.joined`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "member.joined"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "member_removed": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `member.removed`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "member.removed"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "member_role_changed": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `member.role_changed`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "member.role_changed"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "org_sso_config_changed": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `org.sso_config_changed`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "org.sso_config_changed"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "pack_purchased": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `pack.purchased`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "pack.purchased"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "plan_changed": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `plan.changed`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "plan.changed"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "retention_updated": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `retention.updated`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "retention.updated"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "webhook_created": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `webhook.created`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "webhook.created"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "webhook_deleted": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `webhook.deleted`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "webhook.deleted"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "webhook_updated": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `webhook.updated`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "webhook.updated"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "workspace_created": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `workspace.created`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "workspace.created"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "workspace_deletion_canceled": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `workspace.deletion_canceled`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "workspace.deletion_canceled"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "workspace_renamed": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `workspace.renamed`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "workspace.renamed"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "workspace_scheduled_deletion": {
          "contentType": "application/json",
          "summary": "Webhook event of kind `workspace.scheduled_deletion`.",
          "headers": {
            "type": "object",
            "required": [
              "X-Intramedial-Signature",
              "X-Intramedial-Event-Id",
              "X-Intramedial-Timestamp"
            ],
            "properties": {
              "X-Intramedial-Signature": {
                "type": "string",
                "description": "HMAC-SHA256(timestamp + '.' + body), prefixed `t=…,v1=…`. Plus an Ed25519 detached signature `s=…` over the same."
              },
              "X-Intramedial-Event-Id": {
                "type": "string"
              },
              "X-Intramedial-Timestamp": {
                "type": "string",
                "description": "RFC 3339 — protects against replay."
              }
            }
          },
          "payload": {
            "type": "object",
            "required": [
              "id",
              "type",
              "createdAt",
              "workspaceId",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "const": "workspace.scheduled_deletion"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string",
                "pattern": "^ws_[0-9A-Z]{20,}$"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "sse-number-one-stream": {
      "address": "/api/v1/number_one/conversation/{conversationId}/stream",
      "parameters": {
        "conversationId": {
          "description": "Conversation id."
        }
      },
      "messages": {
        "chunk": {
          "summary": "One streamed chunk of an assistant response.",
          "payload": {
            "type": "object",
            "required": [
              "role",
              "delta"
            ],
            "properties": {
              "role": {
                "const": "assistant"
              },
              "delta": {
                "type": "string"
              },
              "done": {
                "type": "boolean"
              }
            }
          }
        }
      }
    },
    "sse-audit-log-live": {
      "address": "/api/v1/audit/workspace/{workspaceId}/live",
      "parameters": {
        "workspaceId": {
          "description": "Workspace id."
        }
      },
      "messages": {
        "audit_entry": {
          "summary": "One newly-committed audit log entry.",
          "payload": {
            "type": "object",
            "additionalProperties": true
          }
        }
      }
    }
  },
  "operations": {
    "sendWebhook": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/webhook-event"
      },
      "summary": "Intramedial POSTs a signed event to the customer's webhook endpoint.",
      "bindings": {
        "http": {
          "method": "POST"
        }
      }
    },
    "consumeNumberOneStream": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/sse-number-one-stream"
      },
      "summary": "Subscribe to a Number One conversation's streamed response."
    },
    "consumeAuditLogLive": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/sse-audit-log-live"
      },
      "summary": "Subscribe to the workspace's live audit log feed."
    }
  },
  "components": {
    "securitySchemes": {
      "WebhookSignature": {
        "type": "symmetricEncryption",
        "description": "HMAC-SHA256 + detached Ed25519 signature on webhook payloads."
      },
      "BearerPat": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Intramedial PAT (itml_pat_*)"
      }
    }
  }
}
