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

---

[API](https://skmtc.net/surrealdb/apis/spectron.md) · [All operations](https://skmtc.net/surrealdb/apis/spectron/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/surrealdb/spectron/versions/52b41ab517b6/schema)
