---
title: "Select the active workspace for this browser session"
method: POST
path: "/v1/auth/workspace"
tags: ["auth"]
---

# Select the active workspace for this browser session

`POST /v1/auth/workspace`

## Request

- Base URL: `https://api.hyperresearch.ai`
- URL: `https://api.hyperresearch.ai/v1/auth/workspace`
- Auth: API key in cookie `hr_session`

Validates same-account membership and active status, then atomically rotates CSRF so racing switches cannot silently win.

## Request body

- AuthSelectWorkspaceRequest
  - `workspace_id` string, required

## Response `200`

Updated session

- AuthSessionResult
  - `account` AuthAccount, required
    - `id` string, required
    - `email` string, required
    - `name` string, nullable, required
    - `plan` string, required
    - `status` string, required
    - `card_on_file` boolean, required
    - `trial` object, required
      - `light_remaining` number, required
      - `full_remaining` number, required
      - `premier_remaining` number, required
    - `free_deep_available` boolean
    - `deletion` object, nullable
      - `status` 'scheduled' | 'purging' | 'purged', required
      - `scheduled_for` string, nullable, required
      - `cancellable` boolean, required
  - `user` object, required
    - `id` string, required
    - `email` string, required
    - `role` string, required
  - `workspace` object, required
    - `id` string, required
    - `name` string, required
    - `status` string, required
  - `csrf_token` string, nullable, required
  - `session` AuthSessionExpiry, required
    - `expires_at` string, required
  - `card_required` boolean, required

## Other responses

- `400`: Invalid request
- `401`: Authentication failed
- `403`: Insufficient scope or plan
- `404`: Not found
- `429`: Rate limited or over quota
- `500`: Internal error

---

[API](https://skmtc.dev/hyperresearch/apis/hyperresearch-cloud-api.md) · [All operations](https://skmtc.dev/hyperresearch/apis/hyperresearch-cloud-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hyperresearch/apis/hyperresearch-cloud-api/revisions/726ef831ebf4?raw)
