Skip to the documentation
CLI

openemail tasks

Every command in this namespace, with its arguments, flags and examples.

Commands

Instructions the assistant runs by itself, on a schedule, when mail arrives or when asked: create a task, change, pause, resume and delete it, run it now, hand the assistant a one-off job, follow each run step by step, and approve or deny what a run asks before it acts.

Every command here also takes the global flags, such as --json, --profile and --dry-run. See the global flags

openemail tasks list

List the tasks of the workspace, a page at a time

Scopestasks:readthreads:reademails:readNeeds a sign-inAliasesls

Usage

openemail tasks list [flags]

Resolves one page of tasks, the most recently changed first. A task is an instruction in plain words that the assistant runs by itself: on a schedule, when mail arrives, or only when asked. Each one says what starts it in trigger, how much it may do without asking in autonomy, when it runs next in nextRunAt, how its last run ended in lastRunStatus and how many approval requests wait for an answer in pendingApprovals.

Give status to read only the tasks that are active or only the ones that are paused. pausedReason says why a paused task stopped: user when somebody paused it, failures after 5 failed runs in a row, and plan_limit when the plan no longer covers it.

Add --all to walk every page: a table on a terminal, one JSON object per line when piped or with --ndjson, and one { items, hasMore, nextCursor } document with --json. --max <n> stops after that many items.

Flags

--status <value>

Only tasks in this state: active or paused. Left out, both are listed.

--limit <n>

Page size, from 1 to 100. The server defaults to 25.

--cursor <value>

The nextCursor of the previous page, passed back as it came. Leave it out for the first page.

--all

Fetch every page and stream the items as they arrive.

--max <n>

Stop after this many items. Implies --all.

--ndjson

Print every item as one JSON object per line. Implies --all

Examples

openemail tasks list
With optional flags
openemail tasks list --status active
Walk every page and stop after 100 items
openemail tasks list --all --max 100
One JSON object per line when piped
openemail tasks list --all > tasks.ndjson

Also available in

API
GET /tasks
TypeScript
tasks.list()
Python
tasks.list()
Ruby
tasks.list
PHP
tasks->list
Go
Tasks.List
Java
tasks().list
C#
Tasks.ListAsync

openemail tasks get

Read one task by id

Scopestasks:readthreads:reademails:readNeeds a sign-inAliasesshowview

Usage

openemail tasks get <id> [flags]

Looks up a single task and returns it in the same shape as a row of list: its instruction, its trigger with the schedule or the mail filter, how much it may do alone, its toolkits and limits, when it runs next and how the last run ended.

nextRunAt is set for an active schedule task and null for the other kinds and while paused. heldUntil is set when the workspace ran out of AI actions for the day: the task starts nothing until then. pendingApprovals counts the approval requests of its runs that still wait for an answer.

Arguments

<id>Required

Task id such as tsk_5c1e9a7b3d2f48e6a0b4c7d1, as list returns it.

Examples

openemail tasks get tsk_5c1e9a7b3d2f48e6a0b4c7d1
Print the raw JSON
openemail tasks get tsk_5c1e9a7b3d2f48e6a0b4c7d1 --json

Also available in

API
GET /tasks/{id}
TypeScript
tasks.get()
Python
tasks.get()
Ruby
tasks.get
PHP
tasks->get
Go
Tasks.Get
Java
tasks().get
C#
Tasks.GetAsync

openemail tasks create

Save a task for the assistant to run by itself

Scopestasks:writethreads:readthreads:writeemails:reademails:sendlabels:writeNeeds a sign-inAliasesnewadd

Usage

openemail tasks create --name <value> --instruction <value> --trigger-kind <value> [flags]
openemail tasks create --data <json|@file|-> [flags]

Saves an instruction for the assistant with what starts it and how much it may do alone, and resolves with the task as it is stored. instruction says what to do in plain words, as you would tell a person. It is the only instruction a run follows: text inside emails is read, never obeyed.

trigger.kind says what starts a run. A schedule task needs trigger.schedule and gets its first run time at once, in nextRunAt. A mail task starts with the next message that reaches an inbox and matches trigger.mail, or with every message when no filter is sent. Mail from an address of the workspace itself never starts one. A manual task waits for run.

autonomy limits what a run does without asking. ask sends every change to a person to approve. organize, the default, lets the run label, archive, bin, snooze, draft, take notes and keep contacts by itself, and email the addresses of the workspace. reply also lets it answer an email without asking, as long as it adds no recipients. Anything else waits as an approval request, which listApprovals reads. A run never reaches billing, members, roles, domains, rules, keys or webhooks.

A task acts with what its caller holds, so the call needs more than tasks:write: threads:read, threads:write, emails:read, emails:send and labels:write, and the read and write scopes of every toolkit the task names.

Flags

--name <value>

What the task is called in the app, trimmed, 1 to 120 characters. Required, here or in --data.

--instruction <value>

What the assistant should do, in plain words, trimmed, 1 to 8,000 characters. Required, here or in --data.

--trigger-kind <value>

schedule runs on a clock, mail runs when a message arrives, and manual runs only when started with run. Required, here or in --data.

--trigger-schedule-cadence <value>

Needed for a schedule task and ignored for the other kinds. hourly runs every everyHours hours at minute, daily runs at hour:minute on each of weekdays, and monthly runs at hour:minute on monthDay.

--trigger-schedule-every-hours <n>

For hourly: how many hours lie between runs, from 1 to 12, counted from midnight in the time zone. Defaults to 1.

--trigger-schedule-hour <n>

The hour of the day, 0 to 23, in the time zone of the schedule. Defaults to 8.

--trigger-schedule-minute <n>

The minute of the hour, 0 to 59. Defaults to 0.

--trigger-schedule-weekdays <n,n>Repeatable

For daily: the days it runs, 0 for Sunday to 6 for Saturday. Left out, it runs every day.

--trigger-schedule-month-day <n>

For monthly: the day of the month, 1 to 28. Defaults to 1.

--trigger-schedule-timezone <value>

An IANA time zone such as Europe/Berlin. The schedule follows its clock changes. Defaults to UTC.

--trigger-mail-addresses <a,b>Repeatable

For a mail task: start only for mail delivered to one of these addresses of the workspace, at most 25. Left out or empty, every address counts.

--trigger-mail-from-contains <value>

For a mail task: start only when the sender address contains this text, whatever the case, up to 200 characters.

--trigger-mail-subject-contains <value>

For a mail task: start only when the subject contains this text, whatever the case, up to 200 characters.

--autonomy <value>

How much a run may do without asking: ask, organize or reply. Defaults to organize.

--toolkits <a,b>Repeatable

Extra groups of tools a run may use beyond reading and organising mail: contacts, audiences, templates, tracking, translate, files, notes, drafts, sent, insights, subscriptions, calendar, knowledge, connectors and web. Left out, drafts, notes and knowledge. An empty array gives it none.

--model <value>

standard is the everyday model. advanced reasons better over long jobs and costs ten AI actions where the standard one costs one. Defaults to standard.

--notify <value>

attention notifies the workspace owner when a run waits for approval or fails, always also when it finishes, and never stays silent. Defaults to attention.

--max-runs-per-day <n>

The most runs the task may start in any 24 hours, however often its trigger fires, from 1 to 500. Defaults to 50.

--max-steps <n>

The most model steps one run may take before it has to write its report, from 1 to 60. Defaults to 20.

--paused

true creates the task paused, so it does not run until resume. A paused task does not count against the active tasks of the plan.

--data <json|@file|->

The whole body as JSON, inline, from a file with @path, or - for standard input. Flags override its keys.

Examples

The required values only
openemail tasks create --name 'Label invoices' --instruction 'When an invoice arrives, label it Invoices and add a note with the amount and the due date.' --trigger-kind mail
With optional flags
openemail tasks create --name 'Label invoices' --instruction 'When an invoice arrives, label it Invoices and add a note with the amount and the due date.' --trigger-kind mail --trigger-mail-subject-contains invoice --autonomy organize
Read the whole body from a JSON file
openemail tasks create --data @task.json

Also available in

API
POST /tasks
TypeScript
tasks.create()
Python
tasks.create()
Ruby
tasks.create
PHP
tasks->create
Go
Tasks.Create
Java
tasks().create
C#
Tasks.CreateAsync

openemail tasks update

Change what a task does, what starts it or how much it may do alone

Scopestasks:writethreads:readthreads:writeemails:reademails:sendlabels:writeNeeds a sign-inAliasesedit

Usage

openemail tasks update <id> [flags]

Changes a task and resolves with it as it is stored. Send only what changes: a field left out stays as it is, and a patch with nothing in it is a 422.

A new trigger replaces the old one whole. Send its kind and, for a schedule, the whole schedule again, because what the new trigger leaves out goes back to its default, not to what the task had. A schedule change moves nextRunAt of an active task.

Runs already started keep the settings they began with, and later runs follow the new ones. It neither pauses nor resumes a task: pause and resume do that. Like create, the call needs the scopes the task acts with, counted from the toolkits it has after the change.

Arguments

<id>Required

Task id such as tsk_5c1e9a7b3d2f48e6a0b4c7d1, as list returns it.

Flags

--name <value>

New name, trimmed, 1 to 120 characters. Left out, the name stays.

--instruction <value>

New instruction in plain words, trimmed, 1 to 8,000 characters. Left out, the instruction stays.

--trigger-kind <value>

Needed whenever any part of trigger is sent: schedule, mail or manual.

--trigger-schedule-cadence <value>

Needed for a schedule trigger: hourly, daily or monthly.

--trigger-schedule-every-hours <n>

For hourly: how many hours lie between runs, from 1 to 12, counted from midnight in the time zone. Defaults to 1.

--trigger-schedule-hour <n>

The hour of the day, 0 to 23, in the time zone of the schedule. Defaults to 8.

--trigger-schedule-minute <n>

The minute of the hour, 0 to 59. Defaults to 0.

--trigger-schedule-weekdays <n,n>Repeatable

For daily: the days it runs, 0 for Sunday to 6 for Saturday. Left out, it runs every day.

--trigger-schedule-month-day <n>

For monthly: the day of the month, 1 to 28. Defaults to 1.

--trigger-schedule-timezone <value>

An IANA time zone such as Europe/Berlin. Defaults to UTC.

--trigger-mail-addresses <a,b>Repeatable

For a mail trigger: start only for mail delivered to one of these addresses of the workspace, at most 25. Left out or empty, every address counts.

--trigger-mail-from-contains <value>

For a mail trigger: start only when the sender address contains this text, whatever the case, up to 200 characters.

--trigger-mail-subject-contains <value>

For a mail trigger: start only when the subject contains this text, whatever the case, up to 200 characters.

--autonomy <value>

How much a run may do without asking: ask, organize or reply. Left out, it stays.

--toolkits <a,b>Repeatable

The toolkits a run may use from now on, replacing the list the task had. An empty array gives it none. Left out, they stay.

--model <value>

standard or advanced, which costs ten AI actions where the standard one costs one. Left out, it stays.

--notify <value>

When the workspace owner is notified: attention, always or never. Left out, it stays.

--max-runs-per-day <n>

The most runs the task may start in any 24 hours, from 1 to 500. Left out, it stays.

--max-steps <n>

The most model steps one run may take, from 1 to 60. Left out, it stays.

--data <json|@file|->

The whole patch as JSON, inline, from a file with @path, or - for standard input. Flags override its keys.

Examples

With optional flags
openemail tasks update tsk_5c1e9a7b3d2f48e6a0b4c7d1 --trigger-kind schedule --trigger-schedule-cadence daily --trigger-schedule-hour 8
Print the raw JSON
openemail tasks update tsk_5c1e9a7b3d2f48e6a0b4c7d1 --trigger-kind schedule --trigger-schedule-cadence daily --trigger-schedule-hour 8 --json

Also available in

API
PATCH /tasks/{id}
TypeScript
tasks.update()
Python
tasks.update()
Ruby
tasks.update
PHP
tasks->update
Go
Tasks.Update
Java
tasks().update
C#
Tasks.UpdateAsync

openemail tasks delete

Delete a task with every run it made

Scopestasks:writeNeeds a sign-in
Asks you to confirm
Aliasesrmdelremove

Usage

openemail tasks delete <id> [flags]

Deletes a task for good, with every run it made and their records. A run in flight is stopped and its open approval requests are closed. What the runs already did in the mailbox stays done.

There is no undo. To stop a task and keep its history, use pause.

Arguments

<id>Required

Task id such as tsk_5c1e9a7b3d2f48e6a0b4c7d1, as list returns it.

Examples

openemail tasks delete tsk_5c1e9a7b3d2f48e6a0b4c7d1
Skip the confirmation, for scripts
openemail tasks delete tsk_5c1e9a7b3d2f48e6a0b4c7d1 --yes

Also available in

API
DELETE /tasks/{id}
TypeScript
tasks.delete()
Python
tasks.delete()
Ruby
tasks.delete
PHP
tasks->delete
Go
Tasks.Delete
Java
tasks().delete
C#
Tasks.DeleteAsync

openemail tasks pause

Stop a task from starting new runs

Scopestasks:writeNeeds a sign-in

Usage

openemail tasks pause <id> [flags]

Stops a task from starting new runs: its schedule no longer fires and arriving mail no longer starts it. A run already going carries on, and its approval requests can still be answered. run still starts a paused task by hand. Pausing a paused task leaves it paused. It takes no body.

Arguments

<id>Required

Task id such as tsk_5c1e9a7b3d2f48e6a0b4c7d1, as list returns it.

Examples

openemail tasks pause tsk_5c1e9a7b3d2f48e6a0b4c7d1
Print the raw JSON
openemail tasks pause tsk_5c1e9a7b3d2f48e6a0b4c7d1 --json

Also available in

API
POST /tasks/{id}/pause
TypeScript
tasks.pause()
Python
tasks.pause()
Ruby
tasks.pause
PHP
tasks->pause
Go
Tasks.Pause
Java
tasks().pause
C#
Tasks.PauseAsync

openemail tasks resume

Turn a paused task back on

Scopestasks:writethreads:readthreads:writeemails:reademails:sendlabels:writeNeeds a sign-in

Usage

openemail tasks resume <id> [flags]

Turns a paused task back on, whoever or whatever paused it: a person, 5 failed runs in a row or the plan. It clears the failure count and heldUntil, and gives a schedule task its next run time. A schedule picks up at its next time, and the runs it missed while paused are not made up. It takes no body.

A task acts with what its caller holds, so the call needs the same scopes as create: threads:read, threads:write, emails:read, emails:send and labels:write beside tasks:write, and the read and write scopes of every toolkit the task names.

Arguments

<id>Required

Task id such as tsk_5c1e9a7b3d2f48e6a0b4c7d1, as list returns it.

Examples

openemail tasks resume tsk_5c1e9a7b3d2f48e6a0b4c7d1
Print the raw JSON
openemail tasks resume tsk_5c1e9a7b3d2f48e6a0b4c7d1 --json

Also available in

API
POST /tasks/{id}/resume
TypeScript
tasks.resume()
Python
tasks.resume()
Ruby
tasks.resume
PHP
tasks->resume
Go
Tasks.Resume
Java
tasks().resume
C#
Tasks.ResumeAsync

openemail tasks run

Start a run of a task now

Scopestasks:writethreads:readthreads:writeemails:reademails:sendlabels:writeNeeds a sign-in

Usage

openemail tasks run <id> [flags]

Starts a run of a task at once, whatever its trigger and whether or not it is paused, and resolves with the run as it was queued. The run works in the background. Read it again with getRun to follow it until status is done, failed or cancelled. While it is waiting, an approval request is open, which listApprovals reads.

The run uses the instruction and the settings the task has now, and counts towards its maxRunsPerDay. It takes no body. A task acts with what its caller holds, so the call needs the same scopes as create, counted from the toolkits of the task.

Arguments

<id>Required

Task id such as tsk_5c1e9a7b3d2f48e6a0b4c7d1, as list returns it.

Examples

openemail tasks run tsk_5c1e9a7b3d2f48e6a0b4c7d1
Print the raw JSON
openemail tasks run tsk_5c1e9a7b3d2f48e6a0b4c7d1 --json

Also available in

API
POST /tasks/{id}/run
TypeScript
tasks.run()
Python
tasks.run()
Ruby
tasks.run
PHP
tasks->run
Go
Tasks.Run
Java
tasks().run
C#
Tasks.RunAsync

openemail tasks list-runs

List task runs, a page at a time

Scopestasks:readthreads:reademails:readNeeds a sign-in

Usage

openemail tasks list-runs [flags]

Resolves one page of runs, newest first: every run in the workspace, or the runs of one task with --task-id. A run is one execution. It belongs to a task, named in --task-id and taskName, or it is a one-off job started with startRun, where both are null.

status is queued until a runner picks the run up, running while it works, waiting while an approval request is open, then done, failed or cancelled. result is the report the run wrote when it finished, and error says why a failed run failed. steps, toolCalls and actions count how often the model was asked what to do next, how many tool calls ran and how many AI actions the run has cost the workspace. getRun adds the record of each step.

Runs are kept for 90 days.

Add --all to walk every page: a table on a terminal, one JSON object per line when piped or with --ndjson, and one { items, hasMore, nextCursor } document with --json. --max <n> stops after that many items.

Flags

--task-id <value>

Only the runs of this task, by its id. Left out, the runs of every task and the one-off runs are listed.

--status <value>

Only runs in this state: queued, running, waiting, done, failed or cancelled.

--limit <n>

Page size, from 1 to 100. The server defaults to 25.

--cursor <value>

The nextCursor of the previous page, passed back as it came. Leave it out for the first page.

--all

Fetch every page and stream the items as they arrive.

--max <n>

Stop after this many items. Implies --all.

--ndjson

Print every item as one JSON object per line. Implies --all

Examples

openemail tasks list-runs
With optional flags
openemail tasks list-runs --task-id tsk_5c1e9a7b3d2f48e6a0b4c7d1 --status failed
Walk every page and stop after 100 items
openemail tasks list-runs --all --max 100
One JSON object per line when piped
openemail tasks list-runs --all > tasks.ndjson

Also available in

API
GET /task-runs
TypeScript
tasks.listRuns()
Python
tasks.list_runs()
Ruby
tasks.list_runs
PHP
tasks->listRuns
Go
Tasks.ListRuns
Java
tasks().listRuns
C#
Tasks.ListRunsAsync

openemail tasks get-run

Read one run with every step it took

Scopestasks:readthreads:reademails:readNeeds a sign-in

Usage

openemail tasks get-run <id> [flags]

Resolves one run with everything it did: the fields of a row of listRuns, the record of the run in transcript, in order, and its approval requests in approvals, newest first. steps stays the count it is in listRuns.

The entry of transcript with role user holds the instruction the run started with. Each entry with role assistant is one step: the text the assistant wrote and calls, the tools it called at that step. A call names its tool as the MCP server lists it, with the args it was called with, done, which is false while the call waits for approval or has not run yet, and result, what the tool answered.

A run is queued, then running, and waiting while an approval request is open. Read it again until it is done, failed or cancelled. result then holds the report it wrote.

Arguments

<id>Required

Run id such as run_2b8d4f6a1c3e5079b6d8f0a2, as listRuns returns it.

Examples

openemail tasks get-run run_2b8d4f6a1c3e5079b6d8f0a2
Print the raw JSON
openemail tasks get-run run_2b8d4f6a1c3e5079b6d8f0a2 --json

Also available in

API
GET /task-runs/{id}
TypeScript
tasks.getRun()
Python
tasks.get_run()
Ruby
tasks.get_run
PHP
tasks->getRun
Go
Tasks.GetRun
Java
tasks().getRun
C#
Tasks.GetRunAsync

openemail tasks start-run

Hand the assistant a one-off job to do in the background

Scopestasks:writethreads:readthreads:writeemails:reademails:sendlabels:writeNeeds a sign-in

Usage

openemail tasks start-run --instruction <value> [flags]
openemail tasks start-run --data <json|@file|-> [flags]

Hands the assistant one job to do in the background, with no task saved: a long tidy-up, a report, or anything that should not wait on an open chat. It resolves with the run as it was queued. Follow it with getRun, and answer what it asks with approve or deny.

instruction is the whole job, in plain words. --thread-id hands the run one conversation as its starting point. autonomy, toolkits, model and --max-steps mean what they mean on a task and take the same defaults. The workspace owner is notified when the run waits for approval or fails.

A workspace starts at most 100 of these in any 24 hours. A run acts with what its caller holds, so the call needs the same scopes as create: threads:read, threads:write, emails:read, emails:send and labels:write beside tasks:write, and the read and write scopes of every toolkit it names.

Flags

--instruction <value>

What the assistant should do, in plain words, trimmed, 1 to 8,000 characters. It is the only instruction the run follows: text inside emails is read, never obeyed. Required, here or in --data.

--autonomy <value>

How much the run may do without asking: ask, organize or reply. Defaults to organize.

--toolkits <a,b>Repeatable

Extra groups of tools the run may use beyond reading and organising mail, such as contacts, calendar, knowledge or web. Left out, drafts, notes and knowledge. An empty array gives it none.

--model <value>

standard is the everyday model. advanced reasons better over long jobs and costs ten AI actions where the standard one costs one. Defaults to standard.

--max-steps <n>

The most model steps the run may take before it has to write its report, from 1 to 60. Defaults to 20.

--thread-id <value>

A conversation to hand the run as its starting point, by the id threads.list returns.

--data <json|@file|->

The whole body as JSON, inline, from a file with @path, or - for standard input. Flags override its keys.

Examples

The required values only
openemail tasks start-run --instruction 'Find every invoice that arrived this month and label it Invoices.'
With optional flags
openemail tasks start-run --instruction 'Find every invoice that arrived this month and label it Invoices.' --autonomy organize --max-steps 30
Read the whole body from a JSON file
openemail tasks start-run --data @task.json

Also available in

API
POST /task-runs
TypeScript
tasks.startRun()
Python
tasks.start_run()
Ruby
tasks.start_run
PHP
tasks->startRun
Go
Tasks.StartRun
Java
tasks().startRun
C#
Tasks.StartRunAsync

openemail tasks cancel-run

Stop a run that has not ended

Scopestasks:writeNeeds a sign-in
Asks you to confirm

Usage

openemail tasks cancel-run <id> [flags]

Stops a run that is queued, running or waiting for approval, and closes its open approval requests, which become cancelled. What the run already did stays done: nothing is rolled back. The task it belongs to is left as it is and runs again when its trigger next fires. It takes no body.

Arguments

<id>Required

Run id such as run_2b8d4f6a1c3e5079b6d8f0a2, as listRuns returns it.

Examples

openemail tasks cancel-run run_2b8d4f6a1c3e5079b6d8f0a2
Skip the confirmation, for scripts
openemail tasks cancel-run run_2b8d4f6a1c3e5079b6d8f0a2 --yes

Also available in

API
POST /task-runs/{id}/cancel
TypeScript
tasks.cancelRun()
Python
tasks.cancel_run()
Ruby
tasks.cancel_run
PHP
tasks->cancelRun
Go
Tasks.CancelRun
Java
tasks().cancelRun
C#
Tasks.CancelRunAsync

openemail tasks list-approvals

List what runs are waiting for a person to allow

Scopestasks:readthreads:reademails:readNeeds a sign-in

Usage

openemail tasks list-approvals [flags]

Resolves one page of approval requests, newest first. An approval request is a tool call a run stopped at because it may not make it alone: tool names the tool, summary says in one line what would happen, and args holds the exact arguments it would be called with. A reply shows the recipients worked out from the message it answers.

Without status the list holds only the requests still pending. Give status to read the ones that were approved, denied, expired or cancelled, and --run-id or --task-id to read those of one run or of one task.

A request waits 7 days. Then it expires and the run carries on without it. Answer one with approve or deny.

Add --all to walk every page: a table on a terminal, one JSON object per line when piped or with --ndjson, and one { items, hasMore, nextCursor } document with --json. --max <n> stops after that many items.

Flags

--status <value>

Only requests in this state: pending, approved, denied, expired or cancelled. Left out, the list holds the ones still pending.

--run-id <value>

Only the requests of this run, by its id.

--task-id <value>

Only the requests of the runs of this task, by its id.

--limit <n>

Page size, from 1 to 100. The server defaults to 25.

--cursor <value>

The nextCursor of the previous page, passed back as it came. Leave it out for the first page.

--all

Fetch every page and stream the items as they arrive.

--max <n>

Stop after this many items. Implies --all.

--ndjson

Print every item as one JSON object per line. Implies --all

Examples

openemail tasks list-approvals
Walk every page and stop after 100 items
openemail tasks list-approvals --all --max 100
One JSON object per line when piped
openemail tasks list-approvals --all > tasks.ndjson

Also available in

API
GET /task-approvals
TypeScript
tasks.listApprovals()
Python
tasks.list_approvals()
Ruby
tasks.list_approvals
PHP
tasks->listApprovals
Go
Tasks.ListApprovals
Java
tasks().listApprovals
C#
Tasks.ListApprovalsAsync

openemail tasks get-approval

Read one approval request by id

Scopestasks:readthreads:reademails:readNeeds a sign-in

Usage

openemail tasks get-approval <id> [flags]

Looks up a single approval request and returns it in the same shape as a row of listApprovals: the run that asked and its task, the tool the run wants to call, the one-line summary, the exact args and its status. args are what will be done once it is approved, unless approve replaces the subject or the words of a send or a reply.

Arguments

<id>Required

Approval request id such as apr_9f3a1c5e7b2d4608a1c3e5f7, as listApprovals returns it.

Examples

openemail tasks get-approval apr_9f3a1c5e7b2d4608a1c3e5f7
Print the raw JSON
openemail tasks get-approval apr_9f3a1c5e7b2d4608a1c3e5f7 --json

Also available in

API
GET /task-approvals/{id}
TypeScript
tasks.getApproval()
Python
tasks.get_approval()
Ruby
tasks.get_approval
PHP
tasks->getApproval
Go
Tasks.GetApproval
Java
tasks().getApproval
C#
Tasks.GetApprovalAsync

openemail tasks approve

Let a run do what it asked for

Scopestasks:writethreads:readthreads:writeemails:reademails:sendlabels:writeNeeds a sign-in
Asks you to confirm

Usage

openemail tasks approve <id> [flags]

Approves a pending request, so the run makes the tool call with the arguments the request shows. For a send or a reply, subject and body replace what the run wrote, and the answer shows the changed args. For any other tool they are ignored. Call it with no body to approve the request as it stands.

The run picks up again once every request of its step is answered, so a run that asked for three things waits for three answers. A task acts with what its caller holds, so approving needs the scopes the run works with: the same as create, counted from the toolkits of its task.

Arguments

<id>Required

Approval request id such as apr_9f3a1c5e7b2d4608a1c3e5f7, as listApprovals returns it.

Flags

--subject <value>

For a send or a reply: the subject to use instead of the one the run wrote, trimmed, 1 to 998 characters.

--body <value>

For a send or a reply: the words to send instead of the ones the run wrote, trimmed, 1 to 100,000 characters.

--data <json|@file|->

The whole body as JSON, inline, from a file with @path, or - for standard input. Flags override its keys.

Examples

The required values only
openemail tasks approve apr_9f3a1c5e7b2d4608a1c3e5f7
With optional flags
openemail tasks approve apr_9f3a1c5e7b2d4608a1c3e5f7 --subject 'Your refund is on its way'
Skip the confirmation, for scripts
openemail tasks approve apr_9f3a1c5e7b2d4608a1c3e5f7 --yes

Also available in

API
POST /task-approvals/{id}/approve
TypeScript
tasks.approve()
Python
tasks.approve()
Ruby
tasks.approve
PHP
tasks->approve
Go
Tasks.Approve
Java
tasks().approve
C#
Tasks.ApproveAsync

openemail tasks deny

Refuse what a run asked for

Scopestasks:writeNeeds a sign-in
Asks you to confirm

Usage

openemail tasks deny <id> [flags]

Denies a pending request. The run is told, does not try that call again, and carries on with the rest of its task once every request of its step is answered. Nothing the request described is done. It takes no body.

Arguments

<id>Required

Approval request id such as apr_9f3a1c5e7b2d4608a1c3e5f7, as listApprovals returns it.

Examples

openemail tasks deny apr_9f3a1c5e7b2d4608a1c3e5f7
Skip the confirmation, for scripts
openemail tasks deny apr_9f3a1c5e7b2d4608a1c3e5f7 --yes

Also available in

API
POST /task-approvals/{id}/deny
TypeScript
tasks.deny()
Python
tasks.deny()
Ruby
tasks.deny
PHP
tasks->deny
Go
Tasks.Deny
Java
tasks().deny
C#
Tasks.DenyAsync