Skip to main content
A session is one piece of agent work: an ask, an automation run, a chat, or the set-up run. GET /v1/sessions/{id} reads one (see Endpoints). The endpoints on this page list them and act on them. Each has an MCP twin with the same payload: list_sessions, cancel_session, delete_session and add_context. See the tool reference.

GET /v1/sessions

Read-only. No credits. MCP tool: list_sessions.
Sessions, newest first.
Shell
Response
status is the three-word vocabulary (complete, running, failed); state is the finer stored word. A cancelled session reads failed under status and cancelled under state.

POST /v1/sessions/{id}/cancel

No credits. Works on a spent balance. MCP tool: cancel_session.
Stops a running session before its next step. Credits already spent on it stay spent. Idempotent: cancelling twice is the same as cancelling once. If the run already finished, the call returns that real ending unchanged; a cancel never rewrites a finished run.
Response

DELETE /v1/sessions/{id}

Destructive. MCP tool: delete_session.
Permanently deletes a finished session and its trace. A running session answers 409: cancel it first.
Response

POST /v1/sessions/{id}/context

Spends credits only with run: true. MCP tool: add_context.
Gives a session text or links it cannot find itself. The agent reads it as a message in the thread. Send text, urls, or both.
  • run: false (default): nothing starts. The session’s next turn reads the context, and a run already in flight picks it up when its current turn ends.
  • run: true: the session is queued again to act on it now. That is a new turn, and it costs credits.
A cancelled session refuses new context.
Shell
Response

POST /v1/sessions/{id}/attachments

No credits. Needs steer. MCP tool: ask, through its files.
Attaches a file to a session so the agent can read it: a security letter, a price list, a screenshot. Send multipart/form-data with one file in a field named file, then reference the returned id in POST /v1/ask as files with the same session. The type is read from the file’s content, not its name. Anything else is 415; a file over 10 MB is 413. A session in another workspace is 404.
Shell
Response
status is read (the text was read), image, or unreadable. An unreadable file, such as a scanned PDF with no text in it, is still attached and still answers 201; notice then says which file it was and to upload it again as a PDF with selectable text. The agent is told it has not read that file, so it will not describe what is in it. The file is private. url is a signed link that works for one hour. To get a fresh one, call GET /v1/sessions/{id}/attachments/{attachment_id}.
Shell
A message can reference at most 5 files, and only files attached to its own session. When a file states a fact about your company, the agent may propose it for your company facts. The proposal waits in your Inbox, and nothing is saved until you approve it. To ask the agent, use POST /v1/ask.

GET /v1/attachments/{id}

Read-only. No credits. Needs read. MCP: get on attensira://{workspace}/attachment/{id}.
Not on api.attensira.com as its own path: read it there as GET /v1/objects/attachment/{id}, or send this path to https://webapp.attensira.com with the same key.
One attachment of any session in the workspace, by its id alone, with a fresh url signed for one hour: the same body as GET /v1/sessions/{id}/attachments/{attachment_id}. An attachment in another workspace is 404. Read through GET /v1/objects/attachment/{id}, the answer also carries it as file.

POST /v1/uploads

No credits. Needs steer. Works on a spent balance. MCP tool: upload.
Not on api.attensira.com yet: send it to https://webapp.attensira.com with the same key, which answers errors in its own envelope.
Hands over one file for an action to use, and answers an upload id. Today one action takes a file: act with answer on a question an agent asked, as payload.file. To give the agent a file to read in a conversation, attach it to the session instead, above. Send JSON with the file base64-encoded, which is what an MCP client can send, or the same multipart/form-data as an attachment, with the file in a field named file: The same types as an attachment are taken (PDF, DOCX, CSV, TXT, PNG, JPG), read from the file’s content and not its name: anything else is 415, and a file over 10 MB is 413.
Shell
Response
An upload belongs to the workspace that made it, is used once, and is deleted a day after it was made if nothing used it. An id from another workspace, an expired one or one already used is 404: upload the file again.