Skip to content

Triggers API

Trigger endpoints управляют trigger definitions, drafts, bulk operations and test helpers.

GET /api/v2/triggers

Возвращает triggers с optional filters.

Arguments:

ArgumentLocationDescription
projectQueryProject fullname filter.
workspaceQueryWorkspace fullname filter.

Payload: нет.

Response: array of trigger views.

GET /api/v2/triggers/:fullname

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

Arguments:

ArgumentLocationDescription
fullnamePathTrigger fullname.

Payload: нет.

Response: trigger object.

PUT /api/v2/triggers/:fullname

Создает или полностью сохраняет trigger.

Arguments:

ArgumentLocationDescription
fullnamePathTrigger fullname. Должен совпадать с payload.fullname.

Payload:

FieldRequiredDescription
nameДаTrigger name внутри project.
fullnameДаTrigger fullname.
projectДаProject fullname.
workspaceДаWorkspace fullname.
backendДаBackend object. Обычно { type: "sdk", trigger, values }.
inputsДаInput schema.
meta.titleДаВидимое название.
meta.descriptionНетОписание.
defaultsНетNotification defaults.
outputНетLegacy output schema.
triggerSpecНетSource matching spec или null.
providersНетArray of provider definitions.
filtersSchemaНетOptional filters schema.
outputSchemaНетHuman/raw output schema.
transformНетJavaScript transform or null.
activationНетJavaScript activation condition or null.
executionPolicyНетRuntime limits override object or null.
statusНет{ status, issue, source, updatedAt }.
tagsНетTags.
labelsНетLabels.

Response: saved trigger.

PATCH /api/v2/triggers/:fullname

Частично изменяет trigger.

Arguments:

ArgumentLocationDescription
fullnamePathTrigger fullname.

Payload:

FieldRequiredDescription
setOne ofObject with dotted paths and values to set.
unsetOne ofArray of dotted paths to remove.
dryRunНетIf true, validate patch without saving.

Response: patched trigger or dry-run result.

DELETE /api/v2/triggers/:fullname

Удаляет trigger.

Arguments:

ArgumentLocationDescription
fullnamePathTrigger fullname.

Payload: нет.

Response: operation result.

POST /api/v2/triggers/patch

Bulk patch для нескольких triggers.

Arguments: нет.

Payload:

FieldRequiredDescription
itemsДаArray of { fullname, set?, unset? }.
dryRunНетValidate without saving.

Response: bulk patch result.

POST /api/v2/triggers/remove

Bulk remove для нескольких triggers.

Arguments: нет.

Payload:

FieldRequiredDescription
fullnamesДаArray of trigger fullnames.
dryRunНетValidate without deleting.

Response: bulk remove result.

GET /api/v2/triggers/:fullname/draft

Возвращает draft view trigger.

Arguments:

ArgumentLocationDescription
fullnamePathTrigger fullname.

Payload: нет.

Response: trigger draft.

PUT /api/v2/triggers/:fullname/draft

Сохраняет draft trigger.

Arguments:

ArgumentLocationDescription
fullnamePathTrigger fullname.

Payload: same shape as PUT /api/v2/triggers/:fullname.

Response: saved draft.

POST /api/v2/triggers/:fullname/draft/validate

Проверяет draft trigger без финального сохранения.

Arguments:

ArgumentLocationDescription
fullnamePathTrigger fullname.

Payload: same shape as trigger save payload.

Response: validation result with issues.

POST /api/v2/triggers/preview

Preview transform/providers output without saving trigger.

Arguments: нет.

Payload:

FieldRequiredDescription
providersДаProvider definitions.
transformДаJavaScript transform object.
inputДаSource item/input for preview.
inputsНетTrigger input values.
outputSchemaНетOutput schema used for formatting.

Response: preview result.

POST /api/v2/triggers/test

Тестирует trigger definition на sample source item.

Arguments: нет.

Payload:

FieldRequiredDescription
triggerSpecДаSource matching spec.
providersДаProvider definitions.
transformДаJavaScript transform.
outputSchemaДаOutput schema.
activationНетActivation condition.
inputsНетInput values.
inputOne ofDirect test input.
testOne ofTest source/match object.

Response: test result with raw/human output and issues.

POST /api/v2/triggers/test-block

Тестирует trigger на конкретном block.

Arguments: нет.

Payload:

FieldRequiredDescription
triggerSpecДаSource matching spec.
providersДаProvider definitions.
transformДаJavaScript transform.
outputSchemaДаOutput schema.
blockДаBlock number.
itemIndexНетSource item index inside block.
activationНетActivation condition.
filtersSchemaНетFilters schema.
inputsНетInput values.

Response: block test result.

POST /api/v2/triggers/providers/test

Тестирует один provider.

Arguments: нет.

Payload:

FieldRequiredDescription
triggerSpecДаSource matching spec.
providerДаProvider definition.
projectНетProject fullname.
workspaceНетWorkspace fullname.
templateValuesНетTemplate values for provider placeholders.

Response: provider output or error details.

GET /api/v2/triggers/runtime-sources

Возвращает runtime data sources, доступные для trigger builder.

Arguments: нет.

Payload: нет.

Response: runtime source list.

POST /api/v2/triggers/find-latest-block

Находит latest block/test input для trigger testing.

Arguments: нет.

Payload: trigger/source-specific search object.

Response: latest block/test input result.

Trigger Spec

triggerSpec describes source matching.

Supported variants:

TypeRequired fieldsOptional fields
evm_logtype, dataSourcecontract, event, abiFragment, topicsCount, dataBytes, testInput
evm_transactiontype, dataSourcetestInput
substrate_eventtype, dataSourcepallet, event, testInput
timertype, intervaltestInput

Provider Definition

Each provider has id, type, optional weight, optional timeoutMs, and optional outputSchema.

Supported provider types:

TypeRequired fieldsMain optional fields
httpid, type, urlmethod, headers, queryParams, body
graphqlid, type, url, queryheaders, variables
rpc with transport: "endpoint"id, type, url, methodheaders, params, body
rpc with transport: "source"id, type, transport, methodparams
substrate_storageid, type, module, entrysource, args, block
evm_readid, type, contract, method, abiFragmentsource, abiContract, args
state_windowid, type, dedupeBy, value, keepLastpartitionBy, valueType, aggregate
javascriptid, type, sourcevariables