API 参考订阅 API

改订阅

改过滤器 / scopes,或暂停恢复。

PATCH/api/v1/subscriptions/{id}
PATCH
/api/v1/subscriptions/{id}

改过滤器 / scopes、暂停或恢复。

改动过滤器时水位线会回退:服务端在同一个事务里把 filtersVersion 加一,并把水位线退到「新命中集合的最早已存周期」,让新纳入的仓库至少被完整推一次——否则它们的历史早于水位线,就永远收不到。代价是已推过的数据可能重复一次,消费方靠 payload 里的 filtersVersion 区分「新数据」与「补发」(§6.4)。

Authorization

bearerAuth
AuthorizationBearer <token>

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

In: header

Path Parameters

id*string

订阅 id(subscriptions.id)

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 PATCH "https://example.com/api/v1/subscriptions/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "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"}