Webhooks
由 openapi.json 自动生成的 7 个端点及其请求、响应和权限元数据。
此参考由已发布 API 契约生成。字段、请求头和权限要求如下。
下载完整 OpenAPI 文档 · SHA-256: ccaa20cec11fad96e369b88073ce3608a5b071ce55d6dc03fa31df7b0f08c525
标识符和数据结构与公开契约一致,说明直接给出调用规则。共享模型见 数据模型.
GET /api/v1/admin/notify/webhook-deliveries
GET /api/v1/admin/notify/webhook-deliveries
{
"parameters": [
{
"in": "query",
"name": "endpoint_id",
"required": false,
"schema": {
"format": "uuid",
"type": "string"
}
},
{
"in": "query",
"name": "before",
"required": false,
"schema": {
"format": "uuid",
"type": "string"
}
},
{
"in": "query",
"name": "limit",
"required": false,
"schema": {
"default": 50,
"maximum": 100,
"minimum": 1,
"type": "integer"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"items": {
"items": {
"properties": {
"attempts": {
"type": "integer"
},
"created_at": {
"type": "string"
},
"endpoint_id": {
"type": "string"
},
"event_id": {
"type": "string"
},
"event_type": {
"type": "string"
},
"id": {
"format": "uuid",
"type": "string"
},
"last_error": {
"type": [
"string",
"null"
]
},
"last_status_code": {
"type": [
"integer",
"null"
]
},
"latency_ms": {
"type": [
"integer",
"null"
]
},
"next_attempt_at": {
"type": [
"string",
"null"
]
},
"status": {
"type": "string"
}
},
"required": [
"id",
"endpoint_id",
"event_id",
"event_type",
"status",
"attempts",
"last_status_code",
"last_error",
"latency_ms",
"next_attempt_at",
"created_at"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"items"
],
"type": "object"
}
}
},
"description": "Success"
}
},
"tags": [
"Webhooks"
],
"x-audit": "notify.webhook.deliveries",
"x-body": "none",
"x-body-limit": 0,
"x-idempotency": "none",
"x-permission": "notify.webhook.manage",
"x-rate-limit": "notify.webhook.admin",
"x-reauth": false,
"effectiveSecurity": []
}POST /api/v1/admin/notify/webhook-deliveries/{id}/retry
POST /api/v1/admin/notify/webhook-deliveries/{id}/retry
{
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"format": "uuid",
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"id": {
"format": "uuid",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
}
}
},
"description": "Success"
}
},
"tags": [
"Webhooks"
],
"x-audit": "notify.webhook.replay",
"x-body": "none",
"x-body-limit": 0,
"x-idempotency": "required",
"x-permission": "notify.webhook.manage",
"x-rate-limit": "notify.webhook.admin",
"x-reauth": false,
"effectiveSecurity": []
}GET /api/v1/admin/notify/webhooks
GET /api/v1/admin/notify/webhooks
{
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"event_types": {
"items": {
"type": "string"
},
"type": "array"
},
"items": {
"items": {
"additionalProperties": false,
"properties": {
"event_types": {
"items": {
"enum": [
"iam.user.registered",
"commerce.order.created",
"commerce.order.paid",
"commerce.order.closed",
"commerce.refund.succeeded",
"subscription.subscription.activated",
"subscription.subscription.expired",
"subscription.subscription.cancelled",
"subscription.subscription.suspended",
"subscription.subscription.resumed",
"subscription.subscription.refunded",
"subscription.subscription.exhausted",
"subscription.subscription.renewed",
"subscription.subscription.reset",
"subscription.subscription.plan_changed",
"subscription.access.changed"
],
"type": "string"
},
"maxItems": 20,
"minItems": 1,
"type": "array"
},
"id": {
"format": "uuid",
"type": "string"
},
"name": {
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"paused": {
"default": false,
"type": "boolean"
},
"url": {
"maxLength": 2048,
"type": "string"
},
"version": {
"type": "integer"
}
},
"required": [
"name",
"url",
"event_types",
"id",
"version"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"items",
"event_types"
],
"type": "object"
}
}
},
"description": "Success"
}
},
"tags": [
"Webhooks"
],
"x-audit": "notify.webhook.list",
"x-body": "none",
"x-body-limit": 0,
"x-idempotency": "none",
"x-permission": "notify.webhook.manage",
"x-rate-limit": "notify.webhook.admin",
"x-reauth": false,
"effectiveSecurity": []
}POST /api/v1/admin/notify/webhooks
POST /api/v1/admin/notify/webhooks
{
"requestBody": {
"content": {
"application/json": {
"schema": {
"additionalProperties": false,
"properties": {
"event_types": {
"items": {
"enum": [
"iam.user.registered",
"commerce.order.created",
"commerce.order.paid",
"commerce.order.closed",
"commerce.refund.succeeded",
"subscription.subscription.activated",
"subscription.subscription.expired",
"subscription.subscription.cancelled",
"subscription.subscription.suspended",
"subscription.subscription.resumed",
"subscription.subscription.refunded",
"subscription.subscription.exhausted",
"subscription.subscription.renewed",
"subscription.subscription.reset",
"subscription.subscription.plan_changed",
"subscription.access.changed"
],
"type": "string"
},
"maxItems": 20,
"minItems": 1,
"type": "array"
},
"name": {
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"paused": {
"default": false,
"type": "boolean"
},
"url": {
"maxLength": 2048,
"type": "string"
}
},
"required": [
"name",
"url",
"event_types"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"properties": {
"endpoint": {
"additionalProperties": false,
"properties": {
"event_types": {
"items": {
"enum": [
"iam.user.registered",
"commerce.order.created",
"commerce.order.paid",
"commerce.order.closed",
"commerce.refund.succeeded",
"subscription.subscription.activated",
"subscription.subscription.expired",
"subscription.subscription.cancelled",
"subscription.subscription.suspended",
"subscription.subscription.resumed",
"subscription.subscription.refunded",
"subscription.subscription.exhausted",
"subscription.subscription.renewed",
"subscription.subscription.reset",
"subscription.subscription.plan_changed",
"subscription.access.changed"
],
"type": "string"
},
"maxItems": 20,
"minItems": 1,
"type": "array"
},
"id": {
"format": "uuid",
"type": "string"
},
"name": {
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"paused": {
"default": false,
"type": "boolean"
},
"url": {
"maxLength": 2048,
"type": "string"
},
"version": {
"type": "integer"
}
},
"required": [
"name",
"url",
"event_types",
"id",
"version"
],
"type": "object"
},
"secret": {
"type": "string"
}
},
"required": [
"endpoint",
"secret"
],
"type": "object"
}
}
},
"description": "Success"
}
},
"tags": [
"Webhooks"
],
"x-audit": "notify.webhook.create",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-permission": "notify.webhook.manage",
"x-rate-limit": "notify.webhook.admin",
"x-reauth": true,
"effectiveSecurity": []
}GET /api/v1/admin/notify/webhooks/{id}
GET /api/v1/admin/notify/webhooks/{id}
{
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"format": "uuid",
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"additionalProperties": false,
"properties": {
"event_types": {
"items": {
"enum": [
"iam.user.registered",
"commerce.order.created",
"commerce.order.paid",
"commerce.order.closed",
"commerce.refund.succeeded",
"subscription.subscription.activated",
"subscription.subscription.expired",
"subscription.subscription.cancelled",
"subscription.subscription.suspended",
"subscription.subscription.resumed",
"subscription.subscription.refunded",
"subscription.subscription.exhausted",
"subscription.subscription.renewed",
"subscription.subscription.reset",
"subscription.subscription.plan_changed",
"subscription.access.changed"
],
"type": "string"
},
"maxItems": 20,
"minItems": 1,
"type": "array"
},
"id": {
"format": "uuid",
"type": "string"
},
"name": {
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"paused": {
"default": false,
"type": "boolean"
},
"url": {
"maxLength": 2048,
"type": "string"
},
"version": {
"type": "integer"
}
},
"required": [
"name",
"url",
"event_types",
"id",
"version"
],
"type": "object"
}
}
},
"description": "Success"
}
},
"tags": [
"Webhooks"
],
"x-audit": "notify.webhook.read",
"x-body": "none",
"x-body-limit": 0,
"x-idempotency": "none",
"x-permission": "notify.webhook.manage",
"x-rate-limit": "notify.webhook.admin",
"x-reauth": false,
"effectiveSecurity": []
}PUT /api/v1/admin/notify/webhooks/{id}
PUT /api/v1/admin/notify/webhooks/{id}
{
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"format": "uuid",
"type": "string"
}
},
{
"description": "Resource ETag; missing 428, malformed 412, stale 409.",
"in": "header",
"name": "If-Match",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"additionalProperties": false,
"properties": {
"event_types": {
"items": {
"enum": [
"iam.user.registered",
"commerce.order.created",
"commerce.order.paid",
"commerce.order.closed",
"commerce.refund.succeeded",
"subscription.subscription.activated",
"subscription.subscription.expired",
"subscription.subscription.cancelled",
"subscription.subscription.suspended",
"subscription.subscription.resumed",
"subscription.subscription.refunded",
"subscription.subscription.exhausted",
"subscription.subscription.renewed",
"subscription.subscription.reset",
"subscription.subscription.plan_changed",
"subscription.access.changed"
],
"type": "string"
},
"maxItems": 20,
"minItems": 1,
"type": "array"
},
"name": {
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"paused": {
"default": false,
"type": "boolean"
},
"url": {
"maxLength": 2048,
"type": "string"
}
},
"required": [
"name",
"url",
"event_types"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"additionalProperties": false,
"properties": {
"event_types": {
"items": {
"enum": [
"iam.user.registered",
"commerce.order.created",
"commerce.order.paid",
"commerce.order.closed",
"commerce.refund.succeeded",
"subscription.subscription.activated",
"subscription.subscription.expired",
"subscription.subscription.cancelled",
"subscription.subscription.suspended",
"subscription.subscription.resumed",
"subscription.subscription.refunded",
"subscription.subscription.exhausted",
"subscription.subscription.renewed",
"subscription.subscription.reset",
"subscription.subscription.plan_changed",
"subscription.access.changed"
],
"type": "string"
},
"maxItems": 20,
"minItems": 1,
"type": "array"
},
"id": {
"format": "uuid",
"type": "string"
},
"name": {
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"paused": {
"default": false,
"type": "boolean"
},
"url": {
"maxLength": 2048,
"type": "string"
},
"version": {
"type": "integer"
}
},
"required": [
"name",
"url",
"event_types",
"id",
"version"
],
"type": "object"
}
}
},
"description": "Success"
}
},
"tags": [
"Webhooks"
],
"x-audit": "notify.webhook.update",
"x-body": "json",
"x-body-limit": 65536,
"x-concurrency": {
"ifMatch": true
},
"x-idempotency": "optional",
"x-permission": "notify.webhook.manage",
"x-rate-limit": "notify.webhook.admin",
"x-reauth": true,
"effectiveSecurity": []
}POST /api/v1/admin/notify/webhooks/{id}/rotate-secret
POST /api/v1/admin/notify/webhooks/{id}/rotate-secret
{
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"format": "uuid",
"type": "string"
}
},
{
"description": "Resource ETag; missing 428, malformed 412, stale 409.",
"in": "header",
"name": "If-Match",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"additionalProperties": false,
"properties": {
"overlap_seconds": {
"default": 3600,
"maximum": 86400,
"minimum": 0,
"type": "integer"
}
},
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"endpoint": {
"additionalProperties": false,
"properties": {
"event_types": {
"items": {
"enum": [
"iam.user.registered",
"commerce.order.created",
"commerce.order.paid",
"commerce.order.closed",
"commerce.refund.succeeded",
"subscription.subscription.activated",
"subscription.subscription.expired",
"subscription.subscription.cancelled",
"subscription.subscription.suspended",
"subscription.subscription.resumed",
"subscription.subscription.refunded",
"subscription.subscription.exhausted",
"subscription.subscription.renewed",
"subscription.subscription.reset",
"subscription.subscription.plan_changed",
"subscription.access.changed"
],
"type": "string"
},
"maxItems": 20,
"minItems": 1,
"type": "array"
},
"id": {
"format": "uuid",
"type": "string"
},
"name": {
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"paused": {
"default": false,
"type": "boolean"
},
"url": {
"maxLength": 2048,
"type": "string"
},
"version": {
"type": "integer"
}
},
"required": [
"name",
"url",
"event_types",
"id",
"version"
],
"type": "object"
},
"secret": {
"type": "string"
}
},
"required": [
"endpoint",
"secret"
],
"type": "object"
}
}
},
"description": "Success"
}
},
"tags": [
"Webhooks"
],
"x-audit": "notify.webhook.rotate",
"x-body": "json",
"x-body-limit": 65536,
"x-concurrency": {
"ifMatch": true
},
"x-idempotency": "none",
"x-permission": "notify.webhook.manage",
"x-rate-limit": "notify.webhook.admin",
"x-reauth": true,
"effectiveSecurity": []
}