API 参考订阅 API

创建订阅

让雷达每天把新数据推到你的地址。

POST/api/v1/subscriptions
POST
/api/v1/subscriptions

让 VercelAI 雷达每天把新数据推到你的地址上。投递严格挂在两个排行任务都成功之后,所以收到的数据不会缺尚未闭合的周期。

三件事要先分清:

  • key 的 subscriptions:write 管「能不能创建/管理订阅」;订阅自己的 scopes 管「推什么」。投递时按订阅的 scope 读库,不借用调用方 key 的权限。
  • 这把 key 同时也是签名 key:验签密钥由它的 key_hash 派生(响应里的 signingKey),同 key 名下所有订阅共用一个,不需要按订阅分发第二个凭据。
  • 过滤器不是白名单语义而是「先命中即短路」,规则见 §6.6。

Authorization

bearerAuth
AuthorizationBearer <token>

Authorization: Bearer <key>。key 由控制台自助签发,或管理员在 /dashboard 代签

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/subscriptions" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "callbackUrl": "http://example.com",    "scopes": [      "repos.stats"    ]  }'
{  "id": "string",  "name": "string",  "callbackUrl": "string",  "signingKeyPrefix": "string",  "cadence": "daily",  "mode": "batch",  "scopes": [    "repos.stats"  ],  "filters": {    "repoIds": [      "string"    ],    "projectTypes": [      "client"    ],    "categoryCodes": [      "string"    ],    "includePlatformProjects": true,    "includeUncurated": true,    "includeOwnSubmissions": true  },  "filtersVersion": 0,  "enabled": true,  "disabledReason": "too_many_failures",  "watermark": "2019-08-24T14:15:22Z",  "createdAt": "2019-08-24T14:15:22Z",  "expiresAt": "2019-08-24T14:15:22Z",  "signingKey": "string"}