---
title: "POST /api/v1/{context_id}/sessions"
method: POST
path: "/api/v1/{context_id}/sessions"
---

# POST /api/v1/{context_id}/sessions

`POST /api/v1/{context_id}/sessions`

Create a new conversation session

## Path parameters

- `context_id` string, required

## Request body

- CreateSessionRequestJson
  - `metadata` unknown
  - `scopes` array[] — A DNF scope selector: an OR of conjunctive clauses. Each clause is an array of scope paths, ALL of which a reader must cover (AND); the outer array is the OR. E.g. [["team/a"],["team/b","clearance/secret"]] means team/a OR (team/b AND clearance/secret). Empty means unscoped (the caller's default region). A bare string is also accepted as a singleton clause.
    - string[]

## Response `201`

- SessionResponseJson
  - `createdAt` string, required
  - `id` string, required
  - `scopes` array[], required — A DNF scope selector: an OR of conjunctive clauses. Each clause is an array of scope paths, ALL of which a reader must cover (AND); the outer array is the OR. E.g. [["team/a"],["team/b","clearance/secret"]] means team/a OR (team/b AND clearance/secret). Empty means unscoped (the caller's default region). A bare string is also accepted as a singleton clause.
    - string[]

## Other responses

- `401` — Unauthorized
- `422` — Invalid context id
- `503` — Server too busy: the per-pod in-flight request cap was exceeded. Retry per the `Retry-After` header.

## Changes

- **2026-08-24** `9f1598713067` — 1 info
  - added the non-success response with the status `503`
- **2026-06-16** `6ad06b1fefc4` — 1 breaking, 1 warning, 2 info
  - removed the required property `scope` from the response with the `201` status
  - removed the request property `scope`
  - added the new optional request property `scopes`
  - added the required property `scopes` to the response with the `201` status
- **2026-06-08** `741d58b9ef89` — 1 breaking, 1 warning, 2 info
  - removed the required property `scopes` from the response with the `201` status
  - removed the request property `scopes`
  - added the new optional request property `scope`
  - added the required property `scope` to the response with the `201` status

[Change history](https://skmtc.dev/surrealdb/apis/spectron/changes/api/v1/:context_id/sessions/post.md)

---

[API](https://skmtc.dev/surrealdb/apis/spectron.md) · [All operations](https://skmtc.dev/surrealdb/apis/spectron/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/surrealdb/spectron/revisions/9f1598713067/schema)
