Skip to content

Subscriptions API

Subscription endpoints управляют workspace subscriptions, их состоянием, тестированием и delivery logs.

GET /api/v1/subscriptions

Возвращает subscriptions текущего workspace/account.

Arguments: нет. Список фильтруется backend-ом по текущему selected workspace.

Payload: нет.

Response: array of subscription views.

POST /api/v1/subscriptions

Создает subscription напрямую по rules или по template.

Arguments: нет.

Payload for direct trigger subscription:

FieldRequiredDescription
templateНетДля direct mode обычно null или отсутствует.
rulesДаArray of rules. Минимум один rule.
rules[].triggerДаTrigger fullname.
rules[].conditionsДаConditions object для фильтрации rule.
resourcesДаArray of resource fullnames.
actionsНетDelivery actions.
meta.titleНетSubscription title.
stateНетon или off.

Payload for template subscription:

FieldRequiredDescription
template.idДаTemplate id.
template.inputsДаValues for template input schema.
template.topicsДаSelected topic names.
resourcesДаArray of resource fullnames.
actionsНетDelivery actions.
meta.titleНетSubscription title.
stateНетon или off.

Response: created subscription view.

GET /api/v1/subscriptions/:id

Возвращает subscription.

Arguments:

ArgumentLocationDescription
idPathSubscription id.

Payload: нет.

Response: subscription view.

POST /api/v1/subscriptions/:id

Обновляет subscription.

Arguments:

ArgumentLocationDescription
idPathSubscription id.

Payload: same shape as POST /api/v1/subscriptions.

Response: updated subscription view.

DELETE /api/v1/subscriptions/:id

Удаляет subscription.

Arguments:

ArgumentLocationDescription
idPathSubscription id.

Payload: нет.

Response: operation result.

POST /api/v1/subscriptions/:id/state

Меняет state subscription.

Arguments:

ArgumentLocationDescription
idPathSubscription id.

Payload:

FieldRequiredDescription
stateДаon, off или blocked.
issueНетHuman-readable block/disable reason.

Response: updated subscription view.

POST /api/v2/subscriptions/test

Тестирует существующую subscription или draft subscription.

Arguments: нет.

Payload:

FieldRequiredDescription
subscriptionOne ofExisting subscription id.
draftOne ofDraft payload same as subscription.save.params.
ruleIndexНетRule index to test.
modeНетpreview или send.
inputНетRaw source item/test input.
test.sourceНетSource item object.
test.itemIndexНетSource item index.
test.match.hashНетExisting match hash.
test.match.indexНетExisting match index.

Response: preview/send test result.

GET /api/v2/subscriptions/alerts/history

Возвращает subscriptions logs текущего workspace.

Arguments:

ArgumentLocationDescription
limitQuery50, 100, 250 или 500.
statusQuerydelivered, failed, rate_limited, blocked.
directionQuerybefore или after.
datetimeQueryCursor date-time.

Payload: нет.

Response: log entries.

GET /api/v2/subscriptions/:id/alerts/history

Возвращает logs конкретной subscription.

Arguments:

ArgumentLocationDescription
idPathSubscription id.
limitQuery50, 100, 250 или 500.
statusQueryOptional status filter.
directionQuerybefore или after.
datetimeQueryCursor date-time.

Payload: нет.

Response: log entries.