API reference

Assistant Works

The background Works of your personal assistant: longer tasks it carries out step by step - research, comparing, preparing, following something up - and the automations it ran for you. List and read them with their steps, result, parts, files and the questions they wait for you to answer; start a new one from your own system; answer its questions; stop it. A new Work counts in your plan's tasks exactly as one you ask for in the app. 7 endpoints. Add your API key in the authentication panel to send test requests from this page.

List your assistant's Works

GET/api/external/v1/assistant/works

The Works your assistant started for you (listed by their top-level run; a Work's parts are in its detail) and the automations it ran for you, newest first.

Each item: id, kind (WORK or AUTOMATION), mode, title, goal, status (SCHEDULED, QUEUED, RUNNING, WAITING, PAUSED, SLEEPING, COMPLETED, FAILED, CANCELLED, TIMED_OUT), outcome, startedAt, endedAt, rootId, childCount (its parts), costCents (what it was priced at so far, parts included), source (where it came from: CONVERSATION, PULSE, ROUTINE, PERSON - started through this API -, ...), needsAttention with attention (it waits for your answer), and estimate (lowMinutes, highMinutes, expectedBy, basis, overdue) when it was started with one.

Page with before: pass the previous page's nextBefore until it is null. Only your assistant's runs are listed, never the workspace's other Work runs.

Errors: 400 INVALID_STATUS, 400 INVALID_TIME, 403 FEATURE_NOT_ENABLED.

Parameters

  • statusstringquery

    ACTIVE (default: still going) or ALL.

  • beforestringquery

    ISO-8601 time: only what started before it (the previous page's `nextBefore`).

  • limitinteger (int32)query

    Items per page, 1 to 100 (30 by default).

Responses

  • 200OK

Start a Work

POST/api/external/v1/assistant/works

Hands your assistant a Work to do in the background, as when you ask it for one in the app: it plans, works step by step, may ask you questions (they show in its questions and your waiting list) and ends with a summary.

Body:

  • goal (required): what the Work should achieve, complete enough to do without asking - the task, what done looks like, any facts it needs (up to 4,000 characters);
  • title: a short name for it (else one is made from the goal);
  • instructions: how to go about it, limits, what to leave alone;
  • expectedMinutes: your rough guess of how long it takes (1 to 10,080); weighed with how long your Works took before into the estimate it starts with;
  • dueBy: ISO-8601 time you need it by; the assistant is told, and says so in its summary when it cannot make it (nothing stops the Work at that time);
  • notifyWhenDone (default true): its result is brought to you when it ends, in the app and on your phone as your notification settings say;
  • budgetCents: the most it may cost; never more than what is left of today's budget for your assistant's background work (left out: the usual budget).

Answers 201 with the Work as listed (status SCHEDULED when it waits for a free slot among your running Works) and its estimate.

The same rules as in the app hold: a Work is part of your plan's assistant level and counts in the month's tasks. Whatever the Work does that reaches other people (a message, a call, a booking) still waits for your approval as your approval rules say.

Errors: 400 MISSING_FIELD, 400 INVALID_FIELD, 400 INVALID_TIME, 400 DUE_IN_PAST; 409 with the reason as code: PLAN_FEATURE (not on your plan's level; unlockLevel names the first that has it), PLAN_PAUSED (the month's included tasks are used; quota, overuse), BUDGET (today's budget for background work is used up), USAGE_BLOCKED (the balance is negative), DISABLED, HIDDEN, NO_WORK_PROVIDER; 403 FEATURE_NOT_ENABLED.

Request body application/json

  • goalstring
  • titlestring
  • instructionsstring
  • expectedMinutesinteger (int32)
  • dueBystring
  • notifyWhenDoneboolean
  • budgetCentsinteger (int64)

Responses

  • 200OK

Get one Work

GET/api/external/v1/assistant/works/{id}

One of your assistant's Works (at any depth: a part has its own id) or one automation run it started, with:

  • work: the Work as listed (see the list);
  • result: its final summary, else the last summary it gave, else why it stopped; null while it has none;
  • parts: its own sub-runs, oldest first (id, title, status, outcome, result once ended) - each can be opened with this route;
  • files: what it produced or was given (id, kind, label, fileName, mimeType, sizeBytes, createdAt, contentUrl to download it);
  • questions: what it waits for you to decide now, as items of your waiting list (item.kind WORK_INPUT, WORK_APPROVAL, WORK_PLAN or AUTOMATION_INPUT, item.question, item.choices, item.fields, item.deadlineAt ...) with answerable (false for a form that needs a file: answer it in the app).

Errors: 404 WORK_NOT_FOUND (no Work of your assistant has that id), 403 FEATURE_NOT_ENABLED.

Parameters

  • idstring (uuid)pathRequired

Responses

  • 200OK

Stop a Work

POST/api/external/v1/assistant/works/{id}/cancel

Stops one of your assistant's Works with all its parts, as the Stop in the app does; a part still under way stops at its next step. A Work that already ended is left as it is. Answers 200 with the Work as it stands after stopping.

Errors: 404 WORK_NOT_FOUND, 409 WORK_NOT_STOPPABLE (an automation run cannot be stopped here), 403 FEATURE_NOT_ENABLED. lang sets the language of the refusal's message.

Parameters

  • idstring (uuid)pathRequired
  • langstringquery

    Language of the message of a refusal (en, de, tr, ...); else your app language.

Responses

  • 200OK

Download a file of a Work

GET/api/external/v1/assistant/works/{id}/files/{fileId}/content

Streams one of the Work's files (from its files): its own, or one its parent Work shares with its parts. Answers the file's bytes with its type; download=true answers it as an attachment with its file name. Files a Work wrote are never run as a page: they come with Content-Security-Policy: sandbox and X-Content-Type-Options: nosniff.

Errors: 404 WORK_NOT_FOUND, 404 FILE_NOT_FOUND (not this Work's, or its content is no longer stored), 503 FILE_UNREADABLE, 403 FEATURE_NOT_ENABLED.

Parameters

  • idstring (uuid)pathRequired
  • fileIdstring (uuid)pathRequired
  • downloadbooleanquery

    true: as an attachment with its file name.

Responses

  • 200OK

Answer a Work's question

POST/api/external/v1/assistant/works/{id}/questions/{questionId}/answer

Answers one of the Work's open questions (its item.id) as you would in the app's waiting list; the Work goes on with it. Send whichever the question takes:

  • choice: the label of one of its choices (WORK_INPUT with choices);
  • approve: true or false (WORK_APPROVAL: a step waiting for your yes; WORK_PLAN: its plan);
  • text: your answer in words (WORK_INPUT);
  • values: the form's fields by key (AUTOMATION_INPUT; a field that needs a file cannot be filled here);
  • note: a line that goes to the Work with your answer.

Answers 200 with outcome ANSWERED, the question as it stands now and a line for you.

Errors: 404 WORK_NOT_FOUND, 404 QUESTION_NOT_FOUND (not one of this Work's), 400 INVALID_ANSWER (the answer does not fit the question: message says why), 409 ALREADY_HANDLED (answered elsewhere first, or the Work moved on), 409 ANSWER_FAILED (the Work did not take it), 403 FEATURE_NOT_ENABLED.

Parameters

  • idstring (uuid)pathRequired
  • questionIdstring (uuid)pathRequired

Request body application/json

  • choicestring
  • approveboolean
  • textstring
  • valuesobject
  • notestring

Responses

  • 200OK

Read a Work's steps

GET/api/external/v1/assistant/works/{id}/steps

What the Work did, step by step, oldest first, as the Work viewer shows it to you: its plan, its narration and progress notes, the tools it called and what came back, its questions and your answers, status changes. Each step: id (a number, increasing), eventKind, payload (its content, by kind), authorType (WORK or HUMAN), createdAt. The model's own internal turns are left out.

Page with since: pass the previous page's next until it is null. An automation run has no steps here (empty).

Errors: 404 WORK_NOT_FOUND, 403 FEATURE_NOT_ENABLED.

Parameters

  • idstring (uuid)pathRequired
  • sinceinteger (int64)query

    Only steps after this step id (the previous page's `next`).

  • limitinteger (int32)query

    Steps read per page, 1 to 100 (50 by default).

Responses

  • 200OK