Skip to main content
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());
import os, requests

session = requests.get(
    f"https://api.blocks.team/rest/v1/sessions/{session_id}",
    headers={"Authorization": f"ApiKey {os.environ['BLOCKS_API_KEY']}"},
).json()
curl https://api.blocks.team/rest/v1/sessions/$SESSION_ID \
  -H "Authorization: ApiKey $BLOCKS_API_KEY"
import java.net.URI;
import java.net.http.*;

HttpResponse<String> res = HttpClient.newHttpClient().send(
    HttpRequest.newBuilder(URI.create("https://api.blocks.team/rest/v1/sessions/" + sessionId))
        .header("Authorization", "ApiKey " + System.getenv("BLOCKS_API_KEY"))
        .build(),
    HttpResponse.BodyHandlers.ofString());
require "net/http"
require "json"

session = JSON.parse(Net::HTTP.get(
  URI("https://api.blocks.team/rest/v1/sessions/#{session_id}"),
  { "Authorization" => "ApiKey #{ENV['BLOCKS_API_KEY']}" },
))
req, _ := http.NewRequest("GET", "https://api.blocks.team/rest/v1/sessions/"+sessionID, nil)
req.Header.Set("Authorization", "ApiKey "+os.Getenv("BLOCKS_API_KEY"))
res, _ := http.DefaultClient.Do(req)

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.