Выполнить Campaign-команду
/api/v1/developer/campaigns/{campaignId}Закрытый command union создаёт независимую копию, готовит draft и управляет pause/resume/cancel lifecycle через Campaigns-owned policy. Повтор возвращает исходный receipt без route, audience, current-state, settlement и tenant facts.
Право доступаcampaigns.write
Authorization: Bearer YOUR_PROJECT_TOKEN
Параметры
campaignIdобязательно · pathstringminLength: 1 · maxLength: 160JSON Schema
{ "type": "string", "minLength": 1, "maxLength": 160 }idempotency-keyобязательно · headerstringpattern: "^[\\x21-\\x7E]+$" · minLength: 1 · maxLength: 160JSON Schema
{ "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[\\x21-\\x7E]+$" }
Тело запроса
application/jsonunion
Вариант 1
object
operationобязательно- stringenum: ["rename"]
expectedVersionобязательно- integerexclusiveMinimum: 0
nameобязательно- stringminLength: 1 · maxLength: 160
JSON Schema
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"rename"
]
},
"expectedVersion": {
"type": "integer",
"exclusiveMinimum": 0
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 160
}
},
"required": [
"operation",
"expectedVersion",
"name"
],
"additionalProperties": false
}Вариант 2
object
operationобязательно- stringenum: ["delete"]
expectedVersionобязательно- integerexclusiveMinimum: 0
JSON Schema
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"delete"
]
},
"expectedVersion": {
"type": "integer",
"exclusiveMinimum": 0
}
},
"required": [
"operation",
"expectedVersion"
],
"additionalProperties": false
}Вариант 3
object
operationобязательно- stringenum: ["bind_template"]
templateIdобязательно- stringminLength: 1 · maxLength: 160
templateVersionобязательно- integerexclusiveMinimum: 0
JSON Schema
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"bind_template"
]
},
"templateId": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"templateVersion": {
"type": "integer",
"exclusiveMinimum": 0
}
},
"required": [
"operation",
"templateId",
"templateVersion"
],
"additionalProperties": false
}Вариант 4
object
operationобязательно- stringenum: ["bind_sender"]
channelIdобязательно- stringminLength: 1 · maxLength: 160
JSON Schema
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"bind_sender"
]
},
"channelId": {
"type": "string",
"minLength": 1,
"maxLength": 160
}
},
"required": [
"operation",
"channelId"
],
"additionalProperties": false
}Вариант 5
object
operationобязательно- stringenum: ["set_primary_route"]
templateIdобязательно- stringminLength: 1 · maxLength: 160
templateVersionобязательно- integerexclusiveMinimum: 0
channelIdобязательно- stringminLength: 1 · maxLength: 160
JSON Schema
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"set_primary_route"
]
},
"templateId": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"templateVersion": {
"type": "integer",
"exclusiveMinimum": 0
},
"channelId": {
"type": "string",
"minLength": 1,
"maxLength": 160
}
},
"required": [
"operation",
"templateId",
"templateVersion",
"channelId"
],
"additionalProperties": false
}Вариант 6
object
operationобязательно- stringenum: ["set_fallback_route"]
templateIdобязательно- stringminLength: 1 · maxLength: 160
templateVersionобязательно- integerexclusiveMinimum: 0
channelIdобязательно- stringminLength: 1 · maxLength: 160
JSON Schema
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"set_fallback_route"
]
},
"templateId": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"templateVersion": {
"type": "integer",
"exclusiveMinimum": 0
},
"channelId": {
"type": "string",
"minLength": 1,
"maxLength": 160
}
},
"required": [
"operation",
"templateId",
"templateVersion",
"channelId"
],
"additionalProperties": false
}Вариант 7
object
operationобязательно- stringenum: ["remove_fallback_route"]
JSON Schema
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"remove_fallback_route"
]
}
},
"required": [
"operation"
],
"additionalProperties": false
}Вариант 8
object
operationобязательно- stringenum: ["freeze_audience"]
filterобязательно- object
Вложенная схема
objectcontactStatusобязательно- stringenum: ["active","archived","all"]
segmentId- string | nullminLength: 1 · maxLength: 160 · default: null
providerTypesобязательно- arraymaxItems: 100
Вложенная схема
arraymaxItems: 100stringminLength: 1 · maxLength: 160JSON Schema
{ "type": "string", "minLength": 1, "maxLength": 160 }JSON Schema
{ "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 160 }, "maxItems": 100 } requiredTagsобязательно- arraymaxItems: 100
Вложенная схема
arraymaxItems: 100stringminLength: 1 · maxLength: 160JSON Schema
{ "type": "string", "minLength": 1, "maxLength": 160 }JSON Schema
{ "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 160 }, "maxItems": 100 } stageIdsобязательно- arraymaxItems: 100
Вложенная схема
arraymaxItems: 100stringminLength: 1 · maxLength: 160JSON Schema
{ "type": "string", "minLength": 1, "maxLength": 160 }JSON Schema
{ "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 160 }, "maxItems": 100 } loyaltyCardRequired- booleandefault: false
loyaltyLevelIds- arraymaxItems: 100 · default: []
Вложенная схема
arraymaxItems: 100 · default: []stringminLength: 1 · maxLength: 160JSON Schema
{ "type": "string", "minLength": 1, "maxLength": 160 }JSON Schema
{ "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 160 }, "maxItems": 100, "default": [] } minimumLoyaltyBalance- integer | nullminimum: 0 · maximum: 1000000000 · default: null
readyStampOfferIds- arraymaxItems: 100 · default: []
Вложенная схема
arraymaxItems: 100 · default: []stringminLength: 1 · maxLength: 160JSON Schema
{ "type": "string", "minLength": 1, "maxLength": 160 }JSON Schema
{ "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 160 }, "maxItems": 100, "default": [] }
JSON Schema
{ "type": "object", "properties": { "contactStatus": { "type": "string", "enum": [ "active", "archived", "all" ] }, "segmentId": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 160, "default": null }, "providerTypes": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 160 }, "maxItems": 100 }, "requiredTags": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 160 }, "maxItems": 100 }, "stageIds": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 160 }, "maxItems": 100 }, "loyaltyCardRequired": { "type": "boolean", "default": false }, "loyaltyLevelIds": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 160 }, "maxItems": 100, "default": [] }, "minimumLoyaltyBalance": { "type": [ "integer", "null" ], "minimum": 0, "maximum": 1000000000, "default": null }, "readyStampOfferIds": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 160 }, "maxItems": 100, "default": [] } }, "required": [ "contactStatus", "providerTypes", "requiredTags", "stageIds" ], "additionalProperties": false }
JSON Schema
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"freeze_audience"
]
},
"filter": {
"type": "object",
"properties": {
"contactStatus": {
"type": "string",
"enum": [
"active",
"archived",
"all"
]
},
"segmentId": {
"type": [
"string",
"null"
],
"minLength": 1,
"maxLength": 160,
"default": null
},
"providerTypes": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"maxItems": 100
},
"requiredTags": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"maxItems": 100
},
"stageIds": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"maxItems": 100
},
"loyaltyCardRequired": {
"type": "boolean",
"default": false
},
"loyaltyLevelIds": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"maxItems": 100,
"default": []
},
"minimumLoyaltyBalance": {
"type": [
"integer",
"null"
],
"minimum": 0,
"maximum": 1000000000,
"default": null
},
"readyStampOfferIds": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"maxItems": 100,
"default": []
}
},
"required": [
"contactStatus",
"providerTypes",
"requiredTags",
"stageIds"
],
"additionalProperties": false
}
},
"required": [
"operation",
"filter"
],
"additionalProperties": false
}Вариант 9
object
operationобязательно- stringenum: ["schedule"]
scheduledForLocalобязательно- string | nullpattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$"
sendsPerMinuteобязательно- integerminimum: 1 · maximum: 60000
JSON Schema
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"schedule"
]
},
"scheduledForLocal": {
"type": [
"string",
"null"
],
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$"
},
"sendsPerMinute": {
"type": "integer",
"minimum": 1,
"maximum": 60000
}
},
"required": [
"operation",
"scheduledForLocal",
"sendsPerMinute"
],
"additionalProperties": false
}Вариант 10
object
operationобязательно- stringenum: ["duplicate"]
name- stringminLength: 1 · maxLength: 160
JSON Schema
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"duplicate"
]
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 160
}
},
"required": [
"operation"
],
"additionalProperties": false
}Вариант 11
object
operationобязательно- stringenum: ["pause"]
JSON Schema
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"pause"
]
}
},
"required": [
"operation"
],
"additionalProperties": false
}Вариант 12
object
operationобязательно- stringenum: ["resume"]
JSON Schema
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"resume"
]
}
},
"required": [
"operation"
],
"additionalProperties": false
}Вариант 13
object
operationобязательно- stringenum: ["cancel"]
JSON Schema
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"cancel"
]
}
},
"required": [
"operation"
],
"additionalProperties": false
}JSON Schema
{
"oneOf": [
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"rename"
]
},
"expectedVersion": {
"type": "integer",
"exclusiveMinimum": 0
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 160
}
},
"required": [
"operation",
"expectedVersion",
"name"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"delete"
]
},
"expectedVersion": {
"type": "integer",
"exclusiveMinimum": 0
}
},
"required": [
"operation",
"expectedVersion"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"bind_template"
]
},
"templateId": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"templateVersion": {
"type": "integer",
"exclusiveMinimum": 0
}
},
"required": [
"operation",
"templateId",
"templateVersion"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"bind_sender"
]
},
"channelId": {
"type": "string",
"minLength": 1,
"maxLength": 160
}
},
"required": [
"operation",
"channelId"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"set_primary_route"
]
},
"templateId": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"templateVersion": {
"type": "integer",
"exclusiveMinimum": 0
},
"channelId": {
"type": "string",
"minLength": 1,
"maxLength": 160
}
},
"required": [
"operation",
"templateId",
"templateVersion",
"channelId"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"set_fallback_route"
]
},
"templateId": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"templateVersion": {
"type": "integer",
"exclusiveMinimum": 0
},
"channelId": {
"type": "string",
"minLength": 1,
"maxLength": 160
}
},
"required": [
"operation",
"templateId",
"templateVersion",
"channelId"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"remove_fallback_route"
]
}
},
"required": [
"operation"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"freeze_audience"
]
},
"filter": {
"type": "object",
"properties": {
"contactStatus": {
"type": "string",
"enum": [
"active",
"archived",
"all"
]
},
"segmentId": {
"type": [
"string",
"null"
],
"minLength": 1,
"maxLength": 160,
"default": null
},
"providerTypes": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"maxItems": 100
},
"requiredTags": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"maxItems": 100
},
"stageIds": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"maxItems": 100
},
"loyaltyCardRequired": {
"type": "boolean",
"default": false
},
"loyaltyLevelIds": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"maxItems": 100,
"default": []
},
"minimumLoyaltyBalance": {
"type": [
"integer",
"null"
],
"minimum": 0,
"maximum": 1000000000,
"default": null
},
"readyStampOfferIds": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"maxItems": 100,
"default": []
}
},
"required": [
"contactStatus",
"providerTypes",
"requiredTags",
"stageIds"
],
"additionalProperties": false
}
},
"required": [
"operation",
"filter"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"schedule"
]
},
"scheduledForLocal": {
"type": [
"string",
"null"
],
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$"
},
"sendsPerMinute": {
"type": "integer",
"minimum": 1,
"maximum": 60000
}
},
"required": [
"operation",
"scheduledForLocal",
"sendsPerMinute"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"duplicate"
]
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 160
}
},
"required": [
"operation"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"pause"
]
}
},
"required": [
"operation"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"resume"
]
}
},
"required": [
"operation"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"cancel"
]
}
},
"required": [
"operation"
],
"additionalProperties": false
}
],
"$ref": "#/components/schemas/UpdateDeveloperCampaignRequest"
}Примеры запроса
curl --request PATCH 'https://YOUR_NOVA_HOST/api/v1/developer/campaigns/CAMPAIGN_ID' --header 'Authorization: Bearer YOUR_PROJECT_TOKEN' --header 'Idempotency-Key: YOUR_UNIQUE_COMMAND_ID' --header 'Content-Type: application/json' --data '{"operation":"duplicate","name":"Копия Campaign"}'Ответы
200 Campaign command receipt
application/jsonobject
resourceIdобязательно- stringminLength: 1 · maxLength: 160
changedобязательно- boolean
JSON Schema
{
"type": "object",
"properties": {
"resourceId": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"changed": {
"type": "boolean"
}
},
"required": [
"resourceId",
"changed"
],
"$ref": "#/components/schemas/DeveloperMutationResponse"
}400 Invalid Campaign command or idempotency key
application/problem+jsonobject
type- stringformat: "uri" · default: "about:blank"
titleобязательно- string
statusобязательно- integerminimum: 100 · maximum: 599
detail- string
instance- string
errors- object
JSON Schema
{
"type": "object",
"properties": {
"type": {
"type": "string",
"format": "uri",
"default": "about:blank"
},
"title": {
"type": "string"
},
"status": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"detail": {
"type": "string"
},
"instance": {
"type": "string"
},
"errors": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"title",
"status"
]
}401 Invalid developer credential
application/problem+jsonobject
type- stringformat: "uri" · default: "about:blank"
titleобязательно- string
statusобязательно- integerminimum: 100 · maximum: 599
detail- string
instance- string
errors- object
JSON Schema
{
"type": "object",
"properties": {
"type": {
"type": "string",
"format": "uri",
"default": "about:blank"
},
"title": {
"type": "string"
},
"status": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"detail": {
"type": "string"
},
"instance": {
"type": "string"
},
"errors": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"title",
"status"
]
}403 Campaign commands unavailable
application/problem+jsonobject
type- stringformat: "uri" · default: "about:blank"
titleобязательно- string
statusобязательно- integerminimum: 100 · maximum: 599
detail- string
instance- string
errors- object
JSON Schema
{
"type": "object",
"properties": {
"type": {
"type": "string",
"format": "uri",
"default": "about:blank"
},
"title": {
"type": "string"
},
"status": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"detail": {
"type": "string"
},
"instance": {
"type": "string"
},
"errors": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"title",
"status"
]
}404 Campaign not found
application/problem+jsonobject
type- stringformat: "uri" · default: "about:blank"
titleобязательно- string
statusобязательно- integerminimum: 100 · maximum: 599
detail- string
instance- string
errors- object
JSON Schema
{
"type": "object",
"properties": {
"type": {
"type": "string",
"format": "uri",
"default": "about:blank"
},
"title": {
"type": "string"
},
"status": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"detail": {
"type": "string"
},
"instance": {
"type": "string"
},
"errors": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"title",
"status"
]
}409 Campaign state, version, lifecycle or idempotency key conflict
application/problem+jsonobject
type- stringformat: "uri" · default: "about:blank"
titleобязательно- string
statusобязательно- integerminimum: 100 · maximum: 599
detail- string
instance- string
errors- object
JSON Schema
{
"type": "object",
"properties": {
"type": {
"type": "string",
"format": "uri",
"default": "about:blank"
},
"title": {
"type": "string"
},
"status": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"detail": {
"type": "string"
},
"instance": {
"type": "string"
},
"errors": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"title",
"status"
]
}429 Developer API rate limit exceeded
application/problem+jsonobject
type- stringformat: "uri" · default: "about:blank"
titleобязательно- string
statusобязательно- integerminimum: 100 · maximum: 599
detail- string
instance- string
errors- object
JSON Schema
{
"type": "object",
"properties": {
"type": {
"type": "string",
"format": "uri",
"default": "about:blank"
},
"title": {
"type": "string"
},
"status": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"detail": {
"type": "string"
},
"instance": {
"type": "string"
},
"errors": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"title",
"status"
]
}503 Developer API rate limiter unavailable
application/problem+jsonobject
type- stringformat: "uri" · default: "about:blank"
titleобязательно- string
statusобязательно- integerminimum: 100 · maximum: 599
detail- string
instance- string
errors- object
JSON Schema
{
"type": "object",
"properties": {
"type": {
"type": "string",
"format": "uri",
"default": "about:blank"
},
"title": {
"type": "string"
},
"status": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"detail": {
"type": "string"
},
"instance": {
"type": "string"
},
"errors": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"title",
"status"
]
}