Browse the docs

POST /pending

Runs a macro later: parks a run for a time said the way people say it, from Run Later, the command line, an agent or a script.

Details #

Parks a run of a macro and answers the new run, the same shape GET /pending lists. 201 for a new run; 200 when ifExists is keep and a waiting run already had the key.

curl -s -X POST -H "Authorization: Bearer $TOKEN" -d '{"macro": "Back up", "at": "tomorrow 9", "source": "cli"}' http://127.0.0.1:48080/pending

The time is text, read the way the Run Later field reads it: in 20m, 2h, tonight, tomorrow 9, fri 5pm, next monday, Nov 14 at 3pm or an ISO date. A bare number is seconds from now. Say it in at, in in (a wait: "20m") or in when.

Parameters #

curl --unix-socket "$SWITCHBOARD_HOME/engine.sock" -X POST http://localhost/pending

Run a macro later: park a run for a time said the way people say it. The Unix socket needs no token; loopback 127.0.0.1:48080 needs Authorization: Bearer <api-token>.

Gotchas #

  • A macro may have 200 waiting runs and Switchboard 2,000. Past either, the answer is 400 with the count.

  • A run due in under a second starts at once.

See also #