Sửa chiến dịch
campaigns.updateMCP:campaigns_updateBộ công cụ: Thiết lập tự chạyChange any part of a campaign: steps graph (messages with spintax/variables/media, waits, branches, actions), audience, exclusions, sender accounts and distribution, schedule, settings.
Quyền: Thiết lập tự chạy
Gọi bằng REST v2
curl -X POST https://zl.builera.app/api/public/v2/ops/campaigns.update \
-H "Authorization: Bearer za_live_…" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"campaignId":"3f2b8c1e-5d4a-4e6b-9c7d-1a2b3c4d5e6f","patch":{}}'Mỗi khoá/kết nối tối đa 300 lệnh đọc và 60 lệnh ghi mỗi phút. Gọi lại cùng Idempotency-Key trả đúng kết quả cũ, không làm lại.
Gọi qua MCP
{
"method": "tools/call",
"params": {
"name": "campaigns_update",
"arguments": {
"campaignId": "3f2b8c1e-5d4a-4e6b-9c7d-1a2b3c4d5e6f",
"patch": {}
}
}
}Thêm https://zl.builera.app/mcp vào ứng dụng AI rồi cho phép kết nối; AI chỉ thấy công cụ trong bộ bạn chọn.
Kết quả
HTTP 200
{ "status": "succeeded", "operationId": "…", "data": { … } }Ví dụ đầu vào
{
"campaignId": "3f2b8c1e-5d4a-4e6b-9c7d-1a2b3c4d5e6f",
"patch": {}
}Thay mã (id) mẫu bằng mã thật lấy từ các thao tác liệt kê/tìm kiếm.
Lược đồ đầu vào (JSON Schema)
{
"type": "object",
"properties": {
"campaignId": {
"type": "string",
"format": "uuid",
"description": "Campaign id."
},
"patch": {
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 120
},
"goal": {
"type": "string",
"maxLength": 500
},
"goalStageId": {
"type": "string",
"format": "uuid",
"nullable": true
},
"graph": {
"type": "object",
"properties": {
"start": {
"type": "string",
"minLength": 1,
"maxLength": 40,
"nullable": true
},
"nodes": {
"type": "object",
"additionalProperties": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"type": {
"type": "string",
"enum": [
"friend_request"
]
},
"message": {
"type": "string",
"maxLength": 600
},
"next": {
"type": "string",
"minLength": 1,
"maxLength": 40,
"nullable": true,
"default": null
}
},
"required": [
"id",
"type",
"message"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"type": {
"type": "string",
"enum": [
"send_message"
]
},
"content": {
"type": "object",
"properties": {
"variants": {
"type": "array",
"items": {
"type": "string",
"maxLength": 2000
},
"minItems": 1,
"maxItems": 5
},
"mediaIds": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"maxItems": 5,
"default": []
}
},
"required": [
"variants"
],
"additionalProperties": false
},
"next": {
"type": "string",
"minLength": 1,
"maxLength": 40,
"nullable": true,
"default": null
}
},
"required": [
"id",
"type",
"content"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"type": {
"type": "string",
"enum": [
"tag"
]
},
"add": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"maxItems": 10,
"default": []
},
"remove": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"maxItems": 10,
"default": []
},
"next": {
"type": "string",
"minLength": 1,
"maxLength": 40,
"nullable": true,
"default": null
}
},
"required": [
"id",
"type"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"type": {
"type": "string",
"enum": [
"set_stage"
]
},
"stageId": {
"type": "string",
"format": "uuid"
},
"next": {
"type": "string",
"minLength": 1,
"maxLength": 40,
"nullable": true,
"default": null
}
},
"required": [
"id",
"type",
"stageId"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"type": {
"type": "string",
"enum": [
"assign"
]
},
"userId": {
"type": "string",
"format": "uuid",
"nullable": true
},
"next": {
"type": "string",
"minLength": 1,
"maxLength": 40,
"nullable": true,
"default": null
}
},
"required": [
"id",
"type",
"userId"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"type": {
"type": "string",
"enum": [
"create_task"
]
},
"title": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"dueInHours": {
"type": "integer",
"minimum": 0,
"maximum": 1440,
"default": 24
},
"next": {
"type": "string",
"minLength": 1,
"maxLength": 40,
"nullable": true,
"default": null
}
},
"required": [
"id",
"type",
"title"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"type": {
"type": "string",
"enum": [
"webhook"
]
},
"url": {
"type": "string",
"format": "uri",
"maxLength": 500
},
"next": {
"type": "string",
"minLength": 1,
"maxLength": 40,
"nullable": true,
"default": null
}
},
"required": [
"id",
"type",
"url"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"type": {
"type": "string",
"enum": [
"add_to_group"
]
},
"groupRowId": {
"type": "string",
"format": "uuid"
},
"next": {
"type": "string",
"minLength": 1,
"maxLength": 40,
"nullable": true,
"default": null
}
},
"required": [
"id",
"type",
"groupRowId"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"type": {
"type": "string",
"enum": [
"wait"
]
},
"amount": {
"type": "integer",
"minimum": 1,
"maximum": 8760
},
"unit": {
"type": "string",
"enum": [
"minutes",
"hours",
"days"
]
},
"next": {
"type": "string",
"minLength": 1,
"maxLength": 40,
"nullable": true,
"default": null
}
},
"required": [
"id",
"type",
"amount",
"unit"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"type": {
"type": "string",
"enum": [
"wait_friend"
]
},
"maxDays": {
"type": "integer",
"minimum": 1,
"maximum": 60
},
"next": {
"type": "string",
"minLength": 1,
"maxLength": 40,
"nullable": true,
"default": null
},
"timeoutNext": {
"type": "string",
"minLength": 1,
"maxLength": 40,
"nullable": true,
"default": null
}
},
"required": [
"id",
"type",
"maxDays"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"type": {
"type": "string",
"enum": [
"wait_reply"
]
},
"maxDays": {
"type": "integer",
"minimum": 1,
"maximum": 60
},
"next": {
"type": "string",
"minLength": 1,
"maxLength": 40,
"nullable": true,
"default": null
},
"timeoutNext": {
"type": "string",
"minLength": 1,
"maxLength": 40,
"nullable": true,
"default": null
}
},
"required": [
"id",
"type",
"maxDays"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"type": {
"type": "string",
"enum": [
"branch"
]
},
"condition": {
"anyOf": [
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"replied"
]
}
},
"required": [
"kind"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"is_friend"
]
}
},
"required": [
"kind"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"has_label"
]
},
"labelId": {
"type": "string",
"format": "uuid"
}
},
"required": [
"kind",
"labelId"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"field_equals"
]
},
"key": {
"type": "string",
"maxLength": 40
},
"value": {
"type": "string",
"maxLength": 200
}
},
"required": [
"kind",
"key",
"value"
],
"additionalProperties": false
}
]
},
"yes": {
"type": "string",
"minLength": 1,
"maxLength": 40,
"nullable": true,
"default": null
},
"no": {
"type": "string",
"minLength": 1,
"maxLength": 40,
"nullable": true,
"default": null
}
},
"required": [
"id",
"type",
"condition"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"type": {
"type": "string",
"enum": [
"end"
]
},
"outcome": {
"type": "string",
"enum": [
"success",
"failure"
]
},
"labelId": {
"type": "string",
"format": "uuid",
"nullable": true,
"default": null
}
},
"required": [
"id",
"type",
"outcome"
],
"additionalProperties": false
}
]
}
}
},
"required": [
"start",
"nodes"
],
"additionalProperties": false
},
"audience": {
"type": "object",
"properties": {
"segmentId": {
"type": "string",
"format": "uuid",
"nullable": true,
"default": null
},
"listIds": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"maxItems": 20,
"default": []
},
"filter": {
"type": "object",
"properties": {
"search": {
"type": "string",
"maxLength": 100
},
"labelIds": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"maxItems": 50
},
"labelMode": {
"type": "string",
"enum": [
"any",
"all"
],
"default": "any"
},
"excludeLabelIds": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"maxItems": 50
},
"stageIds": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"maxItems": 50
},
"noStage": {
"type": "boolean"
},
"ownerIds": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"maxItems": 50
},
"sources": {
"type": "array",
"items": {
"type": "string",
"maxLength": 40
},
"maxItems": 20
},
"listIds": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"maxItems": 20
},
"accountId": {
"type": "string",
"format": "uuid"
},
"relations": {
"type": "array",
"items": {
"type": "string",
"enum": [
"stranger",
"request_sent",
"request_received",
"friend",
"blocked"
]
},
"maxItems": 5
},
"hasPhone": {
"type": "boolean"
},
"hasZalo": {
"type": "boolean"
},
"dnc": {
"type": "string",
"enum": [
"exclude",
"only",
"include"
],
"default": "include"
},
"interactedWithinDays": {
"type": "integer",
"minimum": 1,
"maximum": 3650
},
"notInteractedDays": {
"type": "integer",
"minimum": 1,
"maximum": 3650
}
},
"additionalProperties": false,
"nullable": true,
"default": null
},
"contactIds": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"maxItems": 5000,
"default": []
},
"excludeLabelIds": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"maxItems": 20,
"default": []
},
"allowOverlap": {
"type": "boolean",
"default": false
}
},
"additionalProperties": false
},
"senderAccountIds": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"maxItems": 50
},
"distribution": {
"type": "string",
"enum": [
"round_robin",
"quota",
"prefer_friend"
]
},
"schedule": {
"type": "object",
"properties": {
"startAt": {
"type": "string",
"format": "date-time",
"nullable": true,
"default": null
},
"endAt": {
"type": "string",
"format": "date-time",
"nullable": true,
"default": null
},
"days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 6
},
"maxItems": 7,
"default": []
},
"timeZone": {
"type": "string",
"default": "Asia/Ho_Chi_Minh"
},
"repeatEveryDays": {
"type": "integer",
"minimum": 0,
"maximum": 90,
"default": 0
}
},
"additionalProperties": false
},
"settings": {
"type": "object",
"properties": {
"stopKeywords": {
"type": "array",
"items": {
"type": "string",
"maxLength": 40
},
"maxItems": 30,
"default": [
"dừng",
"stop",
"đừng nhắn",
"không quan tâm",
"huỷ",
"hủy"
]
},
"groupRowIds": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"maxItems": 200,
"default": []
},
"postText": {
"type": "string",
"maxLength": 5000,
"default": ""
},
"postMediaIds": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"maxItems": 10,
"default": []
},
"mentionAll": {
"type": "boolean",
"default": false
},
"testContactId": {
"type": "string",
"format": "uuid",
"nullable": true,
"default": null
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"expectedVersion": {
"type": "integer",
"minimum": 1,
"description": "The campaign `version` you read; a newer one answers conflict instead of overwriting."
}
},
"required": [
"campaignId",
"patch"
],
"additionalProperties": false
}