# ASSISTANTS

assistants endpoints.

**Base URL:** `https://api.trustpager.com/functions/v1/api/v1`

## Endpoints

### POST /assistants/handoffs/:id/accept

Approve a hand-off: the request and what the first crew member knew go to the colleague's chat, which starts on it straight away. Returns that chat. Only the person the hand-off is for can approve it.

**Scopes:** `assistants:read` — [full detail](./assistants/post-assistants-handoffs-id-accept.md)

### POST /assistants/conversations/:id/members

Add a teammate to a conversation you started with your AI assistant (only its starter can). Once teammates are in it, the assistant answers when a message is for it (an @mention or a reply to it always is) and stays quiet while people talk to each other.

**Scopes:** `assistants:read`, `chat:write` — [full detail](./assistants/post-assistants-conversations-id-members.md)

### POST /assistants/jobs/:id/continue

Carry on a job your AI assistant paused (status paused_at_limit or interrupted), like pressing Continue in the chat. It reads the saved state, never repeats anything already done, and posts its next reply in the chat. Only the person who asked can continue it. Check progress afterwards with get_assistant_job.

**Scopes:** `assistants:read`, `chat:write` — [full detail](./assistants/post-assistants-jobs-id-continue.md)

### POST /assistants/:key/reports

Add a report for a crew member: a question it answers on a schedule, in your private chat with it (or a team room). Pass preset_id to switch on a ready-made one, or your own name, question and cron_expression. It appears on the Auto Schedules page too.

**Scopes:** `assistants:write` — [full detail](./assistants/post-assistants-key-reports.md)

### POST /assistants/handoffs/:id/decline

Decline a hand-off: nothing is passed on and the card closes.

**Scopes:** `assistants:read` — [full detail](./assistants/post-assistants-handoffs-id-decline.md)

### DELETE /assistants/:key/reports/:id

Delete a crew member's report and its schedule.

**Scopes:** `assistants:write` — [full detail](./assistants/delete-assistants-key-reports-id.md)

### GET /assistants/conversations/:id

One of your conversations with your AI assistant: its title, who is in it, and its latest messages (with which crew member helped on each answer, any crew member still working, and the tools used). limit sets how many messages (default 30).

**Scopes:** `assistants:read` — [full detail](./assistants/get-assistants-conversations-id.md)

### GET /assistants/jobs/:id

One of your AI assistant's jobs: goal, steps, everything already done with the ids it produced, what the done check says is still missing, what it has used against the workspace limits, and a link to its chat.

**Scopes:** `assistants:read` — [full detail](./assistants/get-assistants-jobs-id.md)

### GET /assistants/limits

This workspace's hard limits for the AI assistant: how many people it may message, how many records it may change and how many it may delete in one job before the rest needs approval, and whether deleting several records at once always asks.

**Scopes:** `assistants:read` — [full detail](./assistants/get-assistants-limits.md)

### GET /assistants/:key

One crew member: its name, face, job, what to ask it, whether it is switched on, its knowledge, and your private chat with it.

**Scopes:** `assistants:read` — [full detail](./assistants/get-assistants-key.md)

### GET /assistants/:key/permissions

The most a crew member may do in this workspace (its permission ceiling, as scopes), whether it was changed from the defaults, and the areas in its job (job_areas it can change, look_up_areas it can only read). By default every change waits for approval. What it does for someone is also limited by that person's own role.

**Scopes:** `assistants:read` — [full detail](./assistants/get-assistants-key-permissions.md)

### GET /assistants/primary

The workspace's AI assistant (Evie unless renamed): its name, face and job. One assistant does everything; the workspace picks its face, which sets its personality, and its name. Also says whether your Ask bar is folded into the sidebar.

**Scopes:** `assistants:read` — [full detail](./assistants/get-assistants-primary.md)

### GET /assistants/conversations

Your conversations with your AI assistant, newest first: title, which assistant, how many people are in it, the last message, and its state (working: a crew member is busy on it now; waiting: an approval in it is waiting; idle). 20 at a time: pass next_before from the last page as before for older ones. search matches the title and last message.

**Scopes:** `assistants:read` — [full detail](./assistants/get-assistants-conversations.md)

### GET /assistants/jobs

Your AI assistant's jobs: bigger requests it planned step by step. Each shows its goal, steps, what is already done (with the ids it made), what is still missing, and whether it can be continued. Status: running, waiting_approval, paused_at_limit (hit its step or time limit, use continue_assistant_job), interrupted (cut off, can be continued), done, failed or stopped. Pass status "unfinished" for the ones still open.

**Scopes:** `assistants:read` — [full detail](./assistants/get-assistants-jobs.md)

### GET /assistants

The workspace's AI assistant crew. The crew is switched off: the workspace has ONE AI assistant (the lead, key "chief") that does everything, and only it answers. For it: its name and face, its job, and your private chat with it. The other entries are kept for older messages only. These are AI assistants, not people: for the human team use list_company_users.

**Scopes:** `assistants:read` — [full detail](./assistants/get-assistants.md)

### GET /assistants/handoffs

Your hand-offs between crew members: when one is asked something outside its job it passes it to the right colleague, and you approve it. Filter with status (pending, accepted, declined).

**Scopes:** `assistants:read` — [full detail](./assistants/get-assistants-handoffs.md)

### GET /assistants/:key/reports

A crew member's reports: questions it answers on a schedule (an Auto Schedule), posted into your chat with it or a team room. Also lists its ready-made reports (presets) and which are switched on. Crew members only speak up unprompted through these.

**Scopes:** `assistants:read` — [full detail](./assistants/get-assistants-key-reports.md)

### POST /assistants/conversations/:id/messages

Carry on one of your conversations with your AI assistant: send a message and wait for the answer. Use start_assistant_conversation for an unrelated topic.

**Scopes:** `assistants:read`, `chat:write` — [full detail](./assistants/post-assistants-conversations-id-messages.md)

### POST /assistants/:key/messages

Send a message to a crew member in your private chat with it and wait for its reply (up to about three minutes). Returns its reply text, the tools it used (and any waiting for approval), and a hand-off if it passed the request to a colleague. It works with your permissions and its own, exactly as if you had typed it in the app. Each reply costs credits like any assistant reply.

**Scopes:** `assistants:read`, `chat:write` — [full detail](./assistants/post-assistants-key-messages.md)

### GET /assistants/:key/chat

Your private chat with a crew member: made the first time you ask (with its greeting), then the same chat every time.

**Scopes:** `assistants:read` — [full detail](./assistants/get-assistants-key-chat.md)

### PUT /assistants/limits

Change this workspace's hard limits for the AI assistant (people messaged, records changed, deletes per job, and whether a bulk delete always asks). Past a limit the assistant's action waits for a person's approval. Pass only what changes.

**Scopes:** `assistants:write` — [full detail](./assistants/put-assistants-limits.md)

### PUT /assistants/:key/permissions

Set the most a crew member may do in this workspace, as scopes (e.g. take away "sms:send-approval" so it can never text). Only areas in its job are kept. An empty list goes back to the defaults, where every change waits for approval. Takes effect on its next reply.

**Scopes:** `assistants:write` — [full detail](./assistants/put-assistants-key-permissions.md)

### PUT /assistants/primary

Fold your Ask bar into the sidebar on every page, or bring it back. Only changes it for you.

**Scopes:** `assistants:read` — [full detail](./assistants/put-assistants-primary.md)

### POST /assistants/setup

Choose which crew members are switched on in one go (the answer to "What eats up your week?" at signup): the ones listed are switched on, the rest switched off, and the lead is always on. Also starts the lead's weekday morning briefing in your chat unless morning_briefing is false.

**Scopes:** `assistants:write` — [full detail](./assistants/post-assistants-setup.md)

### POST /assistants/conversations

Start a new conversation with your AI assistant (exactly like typing into the Ask bar) and wait for the answer. Anything that sends or changes data waits for approval as usual. Optionally add teammates. One question costs 10 credits.

**Scopes:** `assistants:read`, `chat:write` — [full detail](./assistants/post-assistants-conversations.md)

### POST /assistants/conversations/:id/stop

Stop the reply your AI assistant is writing in one of your conversations, like pressing Stop in the chat. It stops within a second or two, keeps what it had written so far marked as stopped, and runs nothing further. Anything already waiting for approval stays in the approvals queue (reject it there if you do not want it).

**Scopes:** `assistants:read`, `chat:write` — [full detail](./assistants/post-assistants-conversations-id-stop.md)

### PATCH /assistants/conversations/:id

Rename a conversation you started with your AI assistant, or archive it (hidden from the AI Chats list of everyone in it; archived false brings it back). Only the person who started it can.

**Scopes:** `assistants:read`, `chat:write` — [full detail](./assistants/patch-assistants-conversations-id.md)

### PATCH /assistants/:key

Change a crew member: switch it on or off (switched off, it is hidden from chat lists and does not answer), rename it, change its face, or set its knowledge (for the lead, how the business works, read by the whole crew; for the others, notes just for their job).

**Scopes:** `assistants:write` — [full detail](./assistants/patch-assistants-key.md)

### PATCH /assistants/:key/reports/:id

Change a crew member's report: its question, name, schedule, room, or switch it off with is_active false.

**Scopes:** `assistants:write` — [full detail](./assistants/patch-assistants-key-reports-id.md)
