Genie tasks
Create a Genie task
Gives a Genie a task to run once (run_at) or on a cron schedule (UTC). An editor role is required: a task makes the genie act in the apps it is connected to.
Authorization
AuthorizationstringheaderrequiredBearer <key>, where <key> is a workspace API key or a user API key. See Authentication.
workspace_id*integerThe workspace. List the ones your key can reach with GET /v1/workspaces.
genie_id*stringThe Genie.
uuidregion*RegionsRegion of the genie: besg (Europe) or usnv (United States)
"besg""usnv"Idempotency-Key?|Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.
nullapplication/json- body
name*NameUnique among the workspace's cron tasks of the region
1 <= length <= 255instruction*InstructionWhat the genie is asked each time the task runs
1 <= lengthcron_expression?|Run on this cron schedule (UTC), e.g. '0 8 * * 1-5'; or run_at
nullrun_at?|Run once at this time (future), ISO 8601; or cron_expression
nullstart_time?|With cron_expression: the schedule starts after this time
nullis_shared_with_workspace?Is Shared With Workspacetruevalidate_only?Validate OnlyRun every check of the write and answer 204 without writing: a refused write answers the error the write would
falseCreated
application/json- response
task_id*Task Idname?|nullinstruction?|What the genie is asked each time
nullcron_expression?|nullrun_at?|For a one-time task: when it runs, ISO 8601
nullstart_time?|For a scheduled task: when the schedule starts
nullnext_run_time?|nullis_paused?|nullis_shared_with_workspace?|nullcreated_time?|nullcurl -X POST 'https://api.stacksync.com/v1/workspaces/0/genies/497f6eca-6276-4993-bfeb-53cbbbba6f08/tasks?region=besg' \ -H 'Content-Type: application/json' \ -d '{ "cron_expression": "0 8 * * 1-5", "instruction": "Summarize the deals that changed stage yesterday", "name": "Weekday sales summary"}'{ "task_id": "<task_id>", "name": "<name>", "instruction": "<instruction>", "cron_expression": "<cron_expression>", "run_at": "<run_at>", "start_time": "<start_time>", "next_run_time": "<next_run_time>", "is_paused": false, "is_shared_with_workspace": false, "created_time": "<created_time>"}