---
title: "Draft, GitHub, comments and who is building: the workspace's top bar in one call"
method: GET
path: "/builder/sessions/{sessionId}/collab"
tags: ["Builder"]
---

# Draft, GitHub, comments and who is building: the workspace's top bar in one call

`GET /builder/sessions/{sessionId}/collab`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/builder/sessions/{sessionId}/collab`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Path parameters

- `sessionId` string, uuid, required

## Response `200`

The state

- object
  - `sessionId` string, uuid, required
  - `draft` object, nullable, required
    - `id` string, uuid, required
    - `parentSessionId` string, uuid, required
    - `parentTitle` string, required
    - `status` 'open' | 'kept' | 'discarded', required
  - `openDrafts` integer, required
  - `openThreads` integer, required
  - `github` object, required
    - `state` 'not_connected' | 'pending' | 'synced' | 'ahead' | 'behind' | 'diverged' | 'error', required
    - `available` boolean, required: Whether this server can reach customers' repositories (the GitHub App's key is configured)
    - `installationId` string, nullable, required
    - `accountLogin` string, nullable, required
    - `repoFullName` string, nullable, required
    - `repoUrl` string, nullable, required
    - `branch` string, nullable, required
    - `syncBranch` 'hostingsurge-sync', required
    - `pullRequestUrl` string, nullable, required: diverged: where to open the pull request from hostingsurge-sync
    - `lastSyncedAt` string, nullable, required: ISO-8601 timestamp
    - `error` object, nullable, required
      - `code` string, required
      - `message` string, required
  - `building` object, nullable, required
    - `turnId` string, uuid, required
    - `prompt` string, required
    - `userId` string, uuid, nullable, required
    - `name` string, nullable, required
    - `startedAt` string, required: ISO-8601 timestamp
  - `capabilities` object, required
    - `codeEdit` boolean, required: The team's plan includes code editing and GitHub sync (builder.github_export)
    - `github` boolean, required: The server can reach customers' GitHub repositories
    - `protectedLinks` boolean, required: The preview gateway can check protected share links

## Other responses

- `400`: Invalid request (code invalid_request)
- `401`: Missing or invalid session/token (code unauthorized)
- `402`: Code editing and GitHub sync need a paid plan (code upgrade_required, details.feature builder.github_export), or a limit was reached
- `403`: Authenticated but not permitted (code forbidden)
- `404`: Not found or not visible to the caller (code not_found)
- `409`: A change is running, the editor is stale (details.reason stale), a secret is in the code (secret_detected), or the draft is closed
- `501`: Not available on this server (code not_configured)

---

[API](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api.md) · [All operations](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/revisions/4d08337cdff1?raw)
