Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.blocks.team/llms.txt

Use this file to discover all available pages before exploring further.

GET /rest/v1/sessions/{session_id}
Returns the session record for the authenticated workspace. Use this to look up a session’s metadata after it was created — for example, to resume a conversation by listing its messages.

Request

const session = await fetch(
  `https://api.blocks.team/rest/v1/sessions/${sessionId}`,
  { headers: { Authorization: `ApiKey ${process.env.BLOCKS_API_KEY}` } },
).then((r) => r.json());

Path parameters

session_id
string (uuid)
required
The ID of the session to fetch.

Response

Returns the same shape as Create Session, with one difference: thread_id, _links.thread, and _links.final_message are always null here. Build polling URLs from message responses or from _links.messages instead.
{
  "id": "a196cec6-49cb-4c48-8e4c-2707fb5d6709",
  "title": "Octopus fun fact",
  "pull_requests": [],
  "source_url": null,
  "is_archived": false,
  "is_private": false,
  "created_at": "2026-04-30T18:21:00.000Z",
  "updated_at": "2026-04-30T18:21:42.000Z",
  "thread_id": null,
  "session_html_url": "https://blocks.team/app/sessions/a196cec6-49cb-4c48-8e4c-2707fb5d6709",
  "_links": {
    "self": { "href": "https://api.blocks.team/rest/v1/sessions/a196cec6-49cb-4c48-8e4c-2707fb5d6709" },
    "messages": { "href": "https://api.blocks.team/rest/v1/sessions/a196cec6-49cb-4c48-8e4c-2707fb5d6709/messages" },
    "thread": null,
    "final_message": null
  }
}

Errors

StatusCodeReason
404NOT_FOUNDSession does not exist or belongs to a different workspace.