Skip to content

Templates API

Template endpoints управляют root template project, groups, topics and rules.

GET /api/v2/projects/:fullname/templates

Возвращает templates project.

Arguments:

ArgumentLocationDescription
fullnamePathProject fullname.

Payload: нет.

Response: array of templates.

GET /api/v2/projects/:fullname/template

Возвращает root template project.

Arguments:

ArgumentLocationDescription
fullnamePathProject fullname.

Payload: нет.

Response: root template or not found.

POST /api/v2/projects/:fullname/templates

Создает template/group for project.

Arguments:

ArgumentLocationDescription
fullnamePathProject fullname.

Payload:

FieldRequiredDescription
projectДаProject fullname.
schemaДаTemplate inputs schema.
groupsДаArray of template groups.
topicsДаArray of topics.
rulesДаArray of rules binding topics to triggers.
meta.titleДаTemplate title.
meta.descriptionДаTemplate description.

Response: created template.

GET /api/v2/projects/:fullname/templates/:id

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

Arguments:

ArgumentLocationDescription
fullnamePathProject fullname.
idPathTemplate id.

Payload: нет.

Response: template.

PUT /api/v2/projects/:fullname/templates/:id

Обновляет template.

Arguments:

ArgumentLocationDescription
fullnamePathProject fullname.
idPathTemplate id.

Payload: same shape as POST /api/v2/projects/:fullname/templates.

Response: updated template.

DELETE /api/v2/projects/:fullname/templates/:id

Удаляет template.

Arguments:

ArgumentLocationDescription
fullnamePathProject fullname.
idPathTemplate id.

Payload: нет.

Response: operation result.

Template Payload Details

groups

Each group:

FieldRequiredDescription
nameДаGroup name.
meta.titleДаVisible title.
meta.descriptionДаDescription.

topics

Each topic:

FieldRequiredDescription
nameДаTopic name.
groupДаGroup name/fullname.
selectedByDefaultДаWhether topic is selected by default in subscription wizard.
meta.titleДаVisible title.
meta.descriptionНетDescription.

rules

Each rule:

FieldRequiredDescription
idДаRule id.
triggerДаTrigger fullname.
topicДаTopic name.
inputsНетStatic input mapping or null.
policyНет`{ type: "filter"
conditionsНетConditions object or null.
deprecatedДаWhether rule is deprecated.
requiredValuesДаInput keys required by this rule.