curl --request POST \
--url https://app.gtm-api.com/orchestration/v4/api/mass-actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Team-SID: <api-key>' \
--data '
{
"target_entity": "<string>",
"scope": {
"kind": "objects",
"object_sids": [
"<string>"
]
},
"plan": {
"steps": [
{
"args": {}
}
]
},
"commit_token": "<string>",
"title": "<string>",
"schedule": {
"interval_seconds_min": 43215,
"interval_seconds_max": 43215
}
}
'import requests
url = "https://app.gtm-api.com/orchestration/v4/api/mass-actions"
payload = {
"target_entity": "<string>",
"scope": {
"kind": "objects",
"object_sids": ["<string>"]
},
"plan": { "steps": [{ "args": {} }] },
"commit_token": "<string>",
"title": "<string>",
"schedule": {
"interval_seconds_min": 43215,
"interval_seconds_max": 43215
}
}
headers = {
"Authorization": "Bearer <token>",
"Team-SID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Team-SID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
target_entity: '<string>',
scope: {kind: 'objects', object_sids: ['<string>']},
plan: {steps: [{args: {}}]},
commit_token: '<string>',
title: '<string>',
schedule: {interval_seconds_min: 43215, interval_seconds_max: 43215}
})
};
fetch('https://app.gtm-api.com/orchestration/v4/api/mass-actions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.gtm-api.com/orchestration/v4/api/mass-actions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'target_entity' => '<string>',
'scope' => [
'kind' => 'objects',
'object_sids' => [
'<string>'
]
],
'plan' => [
'steps' => [
[
'args' => [
]
]
]
],
'commit_token' => '<string>',
'title' => '<string>',
'schedule' => [
'interval_seconds_min' => 43215,
'interval_seconds_max' => 43215
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Team-SID: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.gtm-api.com/orchestration/v4/api/mass-actions"
payload := strings.NewReader("{\n \"target_entity\": \"<string>\",\n \"scope\": {\n \"kind\": \"objects\",\n \"object_sids\": [\n \"<string>\"\n ]\n },\n \"plan\": {\n \"steps\": [\n {\n \"args\": {}\n }\n ]\n },\n \"commit_token\": \"<string>\",\n \"title\": \"<string>\",\n \"schedule\": {\n \"interval_seconds_min\": 43215,\n \"interval_seconds_max\": 43215\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Team-SID", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.gtm-api.com/orchestration/v4/api/mass-actions")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"target_entity\": \"<string>\",\n \"scope\": {\n \"kind\": \"objects\",\n \"object_sids\": [\n \"<string>\"\n ]\n },\n \"plan\": {\n \"steps\": [\n {\n \"args\": {}\n }\n ]\n },\n \"commit_token\": \"<string>\",\n \"title\": \"<string>\",\n \"schedule\": {\n \"interval_seconds_min\": 43215,\n \"interval_seconds_max\": 43215\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/orchestration/v4/api/mass-actions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Team-SID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_entity\": \"<string>\",\n \"scope\": {\n \"kind\": \"objects\",\n \"object_sids\": [\n \"<string>\"\n ]\n },\n \"plan\": {\n \"steps\": [\n {\n \"args\": {}\n }\n ]\n },\n \"commit_token\": \"<string>\",\n \"title\": \"<string>\",\n \"schedule\": {\n \"interval_seconds_min\": 43215,\n \"interval_seconds_max\": 43215\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"operation": "create",
"item": {
"sid": "<string>",
"team_sid": "<string>",
"target_entity": "<string>",
"plan": {},
"canary_mode": "none",
"status": "active",
"total_count": 123,
"title": "<string>",
"schedule": {},
"paused_reason": "manual",
"hold_till": "<string>",
"canary_satisfied_at": "<string>",
"started_at": "<string>",
"settled_at": "<string>",
"created_by": {
"actor_type": "user",
"actor_sid": "<string>",
"team_sid": "<string>",
"permissions": {},
"request_sid": "<string>",
"reason": "<string>"
},
"deleted_by": {
"actor_type": "user",
"actor_sid": "<string>",
"team_sid": "<string>",
"permissions": {},
"request_sid": "<string>",
"reason": "<string>"
},
"created_at": "<string>",
"updated_at": "<string>",
"deleted_at": "<string>"
},
"already_exists": true,
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"debug_url": "<string>"
}
}{
"success": false,
"error": {
"code": "validation_failed",
"message": "<string>",
"recoverable": true,
"suggestion": "<string>",
"field_errors": {},
"blockers": [
{
"type": "<string>",
"severity": "hard",
"description": "<string>",
"entity_sid": "<string>",
"resolution": "<string>",
"resolution_hint": "<string>",
"count": 123
}
],
"context": {}
},
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"debug_url": "<string>"
}
}{
"success": false,
"error": {
"code": "validation_failed",
"message": "<string>",
"recoverable": true,
"suggestion": "<string>",
"field_errors": {},
"blockers": [
{
"type": "<string>",
"severity": "hard",
"description": "<string>",
"entity_sid": "<string>",
"resolution": "<string>",
"resolution_hint": "<string>",
"count": 123
}
],
"context": {}
},
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"debug_url": "<string>"
}
}Create mass-action
Commit a previewed plan into a running bulk dispatch. Requires the commit_token from preview_mass_action over EXACTLY these inputs: the server re-derives the HMAC, so an edited plan, a changed scope or a different caller is 422 invalid_commit_token, and a token older than 15 minutes is 422 commit_token_expired. Re-preview in either case.
Re-runs the full preview validation, then inserts the run plus its items and starts dispatching in one transaction. Always asynchronous, even for one item: the returned sid IS the monitoring handle. Poll get_mass_action with include=metrics or get_mass_actions_metrics, or subscribe to the mass-actions.settled / .paused webhooks.
With canary_mode=first_item only item 1 runs until it succeeds; a canary failure pauses the run with paused_reason=canary_failed. A none-scope run is created empty (total_count 0) and dispatches nothing until an auto-scrape appends leads into it. Replaying a still-valid token creates a SECOND identical run, so discard the token after use.
Contract:
- MCP tool
create_mass_action, registry packagemcp.orchestration/mass_actions, mountorchestration.mass_actions. - Operation
create, response envelopecreate. - Flags: none.
curl --request POST \
--url https://app.gtm-api.com/orchestration/v4/api/mass-actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Team-SID: <api-key>' \
--data '
{
"target_entity": "<string>",
"scope": {
"kind": "objects",
"object_sids": [
"<string>"
]
},
"plan": {
"steps": [
{
"args": {}
}
]
},
"commit_token": "<string>",
"title": "<string>",
"schedule": {
"interval_seconds_min": 43215,
"interval_seconds_max": 43215
}
}
'import requests
url = "https://app.gtm-api.com/orchestration/v4/api/mass-actions"
payload = {
"target_entity": "<string>",
"scope": {
"kind": "objects",
"object_sids": ["<string>"]
},
"plan": { "steps": [{ "args": {} }] },
"commit_token": "<string>",
"title": "<string>",
"schedule": {
"interval_seconds_min": 43215,
"interval_seconds_max": 43215
}
}
headers = {
"Authorization": "Bearer <token>",
"Team-SID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Team-SID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
target_entity: '<string>',
scope: {kind: 'objects', object_sids: ['<string>']},
plan: {steps: [{args: {}}]},
commit_token: '<string>',
title: '<string>',
schedule: {interval_seconds_min: 43215, interval_seconds_max: 43215}
})
};
fetch('https://app.gtm-api.com/orchestration/v4/api/mass-actions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.gtm-api.com/orchestration/v4/api/mass-actions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'target_entity' => '<string>',
'scope' => [
'kind' => 'objects',
'object_sids' => [
'<string>'
]
],
'plan' => [
'steps' => [
[
'args' => [
]
]
]
],
'commit_token' => '<string>',
'title' => '<string>',
'schedule' => [
'interval_seconds_min' => 43215,
'interval_seconds_max' => 43215
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Team-SID: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.gtm-api.com/orchestration/v4/api/mass-actions"
payload := strings.NewReader("{\n \"target_entity\": \"<string>\",\n \"scope\": {\n \"kind\": \"objects\",\n \"object_sids\": [\n \"<string>\"\n ]\n },\n \"plan\": {\n \"steps\": [\n {\n \"args\": {}\n }\n ]\n },\n \"commit_token\": \"<string>\",\n \"title\": \"<string>\",\n \"schedule\": {\n \"interval_seconds_min\": 43215,\n \"interval_seconds_max\": 43215\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Team-SID", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.gtm-api.com/orchestration/v4/api/mass-actions")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"target_entity\": \"<string>\",\n \"scope\": {\n \"kind\": \"objects\",\n \"object_sids\": [\n \"<string>\"\n ]\n },\n \"plan\": {\n \"steps\": [\n {\n \"args\": {}\n }\n ]\n },\n \"commit_token\": \"<string>\",\n \"title\": \"<string>\",\n \"schedule\": {\n \"interval_seconds_min\": 43215,\n \"interval_seconds_max\": 43215\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/orchestration/v4/api/mass-actions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Team-SID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_entity\": \"<string>\",\n \"scope\": {\n \"kind\": \"objects\",\n \"object_sids\": [\n \"<string>\"\n ]\n },\n \"plan\": {\n \"steps\": [\n {\n \"args\": {}\n }\n ]\n },\n \"commit_token\": \"<string>\",\n \"title\": \"<string>\",\n \"schedule\": {\n \"interval_seconds_min\": 43215,\n \"interval_seconds_max\": 43215\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"operation": "create",
"item": {
"sid": "<string>",
"team_sid": "<string>",
"target_entity": "<string>",
"plan": {},
"canary_mode": "none",
"status": "active",
"total_count": 123,
"title": "<string>",
"schedule": {},
"paused_reason": "manual",
"hold_till": "<string>",
"canary_satisfied_at": "<string>",
"started_at": "<string>",
"settled_at": "<string>",
"created_by": {
"actor_type": "user",
"actor_sid": "<string>",
"team_sid": "<string>",
"permissions": {},
"request_sid": "<string>",
"reason": "<string>"
},
"deleted_by": {
"actor_type": "user",
"actor_sid": "<string>",
"team_sid": "<string>",
"permissions": {},
"request_sid": "<string>",
"reason": "<string>"
},
"created_at": "<string>",
"updated_at": "<string>",
"deleted_at": "<string>"
},
"already_exists": true,
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"debug_url": "<string>"
}
}{
"success": false,
"error": {
"code": "validation_failed",
"message": "<string>",
"recoverable": true,
"suggestion": "<string>",
"field_errors": {},
"blockers": [
{
"type": "<string>",
"severity": "hard",
"description": "<string>",
"entity_sid": "<string>",
"resolution": "<string>",
"resolution_hint": "<string>",
"count": 123
}
],
"context": {}
},
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"debug_url": "<string>"
}
}{
"success": false,
"error": {
"code": "validation_failed",
"message": "<string>",
"recoverable": true,
"suggestion": "<string>",
"field_errors": {},
"blockers": [
{
"type": "<string>",
"severity": "hard",
"description": "<string>",
"entity_sid": "<string>",
"resolution": "<string>",
"resolution_hint": "<string>",
"count": 123
}
],
"context": {}
},
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"debug_url": "<string>"
}
}Authorizations
Access token issued by gtm.service.id. Its access_identity claim carries team_sid, actor_sid and actor_type, and that team scope is authoritative.
Team scope for tokens that do not carry one. Ignored when the token already names a team.
Body
Request body of create_mass_action.
128- Option 1
- Option 2
- Option 3
- Option 4
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The token preview_mass_action returned for these exact inputs. Not the confirmation token of the protected-tool preview flow: it comes from preview_mass_action and nowhere else.
512255Paces ITEM STARTS with per-gap jitter (item k starts at item k-1 plus a uniform draw from this window). Steps inside one item run contiguously. Mandatory when the plan carries a send-class step.
Show child attributes
Show child attributes
none, first_item