> ## 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 Session

> Fetch a single session by ID.

```http theme={null}
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

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

```python Python theme={null}
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()
```

```bash cURL theme={null}
curl https://api.blocks.team/rest/v1/sessions/$SESSION_ID \
  -H "Authorization: ApiKey $BLOCKS_API_KEY"
```

```java Java theme={null}
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());
```

```ruby Ruby theme={null}
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']}" },
))
```

```go Go theme={null}
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`](https://docs.blocks.team/rest-api/sessions/create#response), 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.

```json theme={null}
{
  "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_group_id": null,
  "plan_artifact_ids": ["c7d3a1b2-5e6f-4a8b-9c0d-1e2f3a4b5c6d"],
  "session_html_url": "https://blocks.team/app/3f2c1d9e-7b4a-4c8e-9d1f-2a6b5c4d3e2f/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

| Status | Code | Reason |
| - | - | - |
| `404` | `NOT_FOUND` | Session does not exist or belongs to a different workspace. |
| `422` | `VALIDATION` | `session_id` is not a UUID. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.