文档API 参考

Rust · 0.1.0

Create User Webhook

POST /api/v1/users/{user}/webhooks

UserService · UserService_CreateUserWebhook

基于协议生成的参考。授权与实例策略仍然生效。结构描述继承自 MIT 许可的应用接口定义;本站不会向真实服务执行示例。

访问权限

仅限所有者:路径中的用户必须是已认证调用者;实例管理员身份不允许在此代替其他账号操作。

目标地址与签名行为

目标地址必须符合实例出站网络策略。创建时未提供签名秘密会自动生成,但不返回;仅通过 GetUserWebhookSigningSecret 获取。列表、创建和更新响应通过 signingSecretSet 表示配置状态,不返回秘密。更新掩码使用 url、display_name 与 signing_secret。启用投递前确认接收端所有权和数据处理方式,因为载荷可能包含笔记正文。

请求

CreateUserWebhook creates a new webhook for a user.

POST/api/v1/users/{user}/webhooks

参数

名称 / 位置类型 / 是否必需描述
user
path
string
必需
The user id.

请求体

必需

application/json · UserWebhook

响应

200 · OK

application/json · UserWebhook

default · Default error response

application/json · Status

完整操作定义

下方保留全部已声明约束、媒体类型和响应细节。结构引用链接到完整定义。

展开 JSON 定义
{
  "tags": [
    "UserService"
  ],
  "description": "CreateUserWebhook creates a new webhook for a user.",
  "operationId": "UserService_CreateUserWebhook",
  "parameters": [
    {
      "name": "user",
      "in": "path",
      "description": "The user id.",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/UserWebhook"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/UserWebhook"
          }
        }
      }
    },
    "default": {
      "description": "Default error response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Status"
          }
        }
      }
    }
  }
}