API reference: macros
List the macros you built in the dashboard, run one on an account, stop it, and see what is running.
List macros
GET /macros returns your saved macros. Macros are built and edited in the dashboard: see the macro guide.
{
"macros": [
{ "id": "9f2c41d8a07b3e65c1d24f80ab93e7d1", "name": "Sell loop", "stepCount": 6, "trigger": "manual", "loopCount": 1 }
],
"limit": 50
}trigger is manual for a macro you start yourself and event for one that fires on a trigger. limit is how many macros your plan can save.
Run a macro
POST /macros/{macroId}/run starts a saved macro on one account, exactly like the Run button.
| Field | Type | Detail |
|---|---|---|
accountId | string | Required. The account to run it on. The account should be online. |
loopCount | number | Optional. 1 to 1000, or -1 to loop until stopped. Defaults to the value saved with the macro. |
loopDelayMs | number | Optional. Pause between loops in milliseconds. Defaults to the saved value. |
curl -X POST https://dashboard.consoleclient.com/api/v1/macros/9f2c41d8a07b3e65c1d24f80ab93e7d1/run \
-H "Authorization: Bearer $CC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"accountId": "[email protected]", "loopCount": 3}'{ "ok": true, "runId": "a1b2c3d4e5f60718293a4b5c" }Keep the runId if you want to stop this exact run later. Running the same macro again on the same account restarts it instead of stacking a second copy, and a run carries on across a reconnect until it finishes or you stop it, the same as in the dashboard.
| Error | HTTP | Meaning |
|---|---|---|
macro_not_found | 404 | No saved macro with that ID. |
invalid_account | 400 | accountId is missing. |
not_assigned | 404 | The account is not running on a backend. Connect it first. |
event_macro_not_supported | 400 | The macro is an event macro. Those are armed per account from the dashboard and fire on their own. |
no_steps, invalid_macro | 400 | The saved macro is empty or no longer valid. Open it in the dashboard and save it again. |
Stop a macro
POST /macros/stop stops macros on one account.
| Field | Type | Detail |
|---|---|---|
accountId | string | Required. |
runId | string | Optional. Stops that one run. Leave it out to stop every manual run on the account. |
{ "ok": true }See what is running
GET /macros/active returns the runs in progress and the armed event macros.
{
"runs": [
{
"accountId": "[email protected]",
"username": "Steve",
"runId": "a1b2c3d4e5f60718293a4b5c",
"macroId": "9f2c41d8a07b3e65c1d24f80ab93e7d1",
"macroName": "Sell loop",
"loopTotal": 3,
"loopCurrent": 2,
"source": "manual",
"startedAt": 1790000460000,
"updatedAt": 1790000520000
}
],
"events": []
}loopTotal is -1 for an endless loop. A run disappears from runs when it finishes, so polling this endpoint is how you wait for a macro to complete.
Check the troubleshooting guide or return to all guides.