stack/docs-mintlify/openapi/server.json
BilalG1 f7e389809e
Some checks failed
all-good: Did all the other checks pass? / all-good (push) Has been cancelled
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Has been cancelled
DB migration compat / Check if migrations changed (push) Has been cancelled
Docker Server Build and Push / Docker Build and Push Server (push) Has been cancelled
Docker Server Build and Run / docker (push) Has been cancelled
Runs E2E API Tests (Local Emulator) / E2E Tests (Local Emulator, Node ${{ matrix.node-version }}) (22.x) (push) Has been cancelled
Runs E2E API Tests / E2E Tests (Node ${{ matrix.node-version }}, Freestyle ${{ matrix.freestyle-mode }}) (mock, 22.x) (push) Has been cancelled
Runs E2E API Tests / E2E Tests (Node ${{ matrix.node-version }}, Freestyle ${{ matrix.freestyle-mode }}) (prod, 22.x) (push) Has been cancelled
Runs E2E API Tests with custom port prefix / build (22.x) (push) Has been cancelled
Runs E2E Fallback Tests / E2E Fallback Tests (Node ${{ matrix.node-version }}) (22.x) (push) Has been cancelled
Lint & build / lint_and_build (24) (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
DB migration compat / Back-compat — Current branch migrations with ${{ needs.check-migrations-changed.outputs.base_branch }} branch code (push) Has been cancelled
DB migration compat / Forward-compat — Current branch code with ${{ needs.check-migrations-changed.outputs.base_branch }} branch migrations (push) Has been cancelled
DB migration compat / No migration changes (skipped) (push) Has been cancelled
feat(hexclave): PR 1 — wire compatibility layer (invisible) (#1475)
## Summary

**Stacked on #1468** (`docs/hexclave-rename-plan` — the plan doc). Diff
vs that base = the actual PR 1 code.

This is **PR 1 of the Hexclave rebrand: the invisible compatibility
layer**. Everything is additive. Old SDKs, old wire identifiers, and old
env var names keep working unchanged. The backend dual-accepts and
dual-emits; new SDK code emits `x-hexclave-*` headers and the
`hexclave_` Bearer prefix; cookies dual-write; env vars dual-read across
every category. **No user-visible rebranding lands here** — that's PR 2.

See [`RENAME-TO-HEXCLAVE.md`](./RENAME-TO-HEXCLAVE.md) → *"PR 1
implementation guide"* for the full per-work-area spec, file pointers,
and chosen approach.

## What's implemented (all 14 PR-1 work-areas)

- **SDK export aliases** — `Hexclave*` aliases for the user-facing
`Stack*` exports added in `packages/template`; codegen propagates them
to `@stackframe/{js,stack,react,tanstack-start}`. React-only aliases
correctly excluded from `@stackframe/js`. (`e60550a2`)
- **JWT issuer dual-accept** — `decodeAccessToken` accepts both
`api.stack-auth.com` and `api.hexclave.com` issuers. Signing unchanged.
(`fc781def`)
- **Request-header dual-accept** — backend + dashboard proxies normalize
`x-hexclave-*` → `x-stack-*` at the existing empty proxy hook (so
`smart-request.tsx` and every route schema keep working unchanged); CORS
allowlists extended via a derive-once helper. (`2a056eac`)
- **MCP `ask_hexclave`** — registered alongside `ask_stack_auth` via a
shared helper; `ask_stack_auth` behavior byte-identical. (`30ffd604`)
- **Dev-tool** — DOM ids + header emit switched.
`window.HexclaveDevTool` exposed alongside `window.StackDevTool`.
(`32131ea7`)
- **The big consolidated commit** (`7fed864a`):
- **Env vars** — central `getEnvVariable` prefix-transform (HEXCLAVE
first, STACK fallback); dashboard + template client env files dual-read;
`turbo.json` globalEnv; `NEXT_PUBLIC_STACK_PORT_PREFIX` renamed outright
across ~82 files including docker.
- **Cookies** — dual-write/dual-read auth (`stack-access`/`-refresh-*`
and custom-domain variants), OAuth-state
(`stack-oauth-{inner,outer}-*`), and low-risk cookies (`stack-is-https`,
`stack-last-seen-changelog-version`). Bypass sites patched (backend
OAuth callback, dashboard remote-dev auth route, impersonation snippets,
snapshot serializer).
- **Bearer prefix** — SDK token parser accepts both `stackauth_` and
`hexclave_`; emits `hexclave_`. Discovery correction: this is purely
SDK-internal — the backend never parses it.
- **Response headers** — backend dual-emits
`x-hexclave-{request-id,actual-status,known-error}`; SDKs dual-read (new
first, stack fallback).
- **SDK request-header emit switch** —
`client/server/admin-interface.ts` + dashboard `api-headers.ts` +
`internal-project-headers.ts` + `feedback-form.tsx` switched to
`x-hexclave-*`. Plus `stack_response_mode` query param.
- **Storage keys** — dev-tool / cli-auth / oauth-button / docs keys
renamed (straight); `stack:session-replay:v1` dual-read so in-progress
recordings survive SDK upgrades; `stack_mfa_attempt_code` dual-read.
- **Query params** — cross-domain params dual-emit/dual-accept via
shared helpers; backend `oauth/authorize` accepts
`hexclave_response_mode` and `stack_response_mode`; `stack-init-id`
renamed.
- **`Symbol.for`** — app-internals symbol gets a parallel
`Symbol.for("Hexclave--app-internals")` getter on each attach site (no
read-site churn — old symbol still attached). 3 file-private symbols
renamed outright.
- **Config discovery** — prefer `hexclave.config.ts`, fall back to
`stack.config.ts` at every discovery site (CLI / dashboard / backend /
local-emulator); `init` writes the new filename; CLI credentials path
migrates.
- **Internal renames** — `StackAssertionError`,
`StackClient/Server/AdminInterface` renamed outright (no alias, per the
"internal-only → rename" rule). ~264 files touched.
- **Review-pass fixes** (`21217fbe`) — three real bugs found by parallel
review agents and fixed:
- `snapshot-serializer.ts` was interpolating the whole
`keyedCookieNamePrefixes` array (`${arr}`) — adding a second prefix
would have corrupted **every** OAuth-cookie snapshot, not just new ones.
- **Docker port-prefix producer/consumer mismatch** —
`entrypoint.sh`/`run-emulator.sh`/cloud-init `user-data` were still
producing `NEXT_PUBLIC_STACK_PORT_PREFIX` while the dashboard sentinel +
consumers had been renamed; silent self-host regression (custom port
prefix would be ignored).
- **Missing `hexclave-oauth-inner-*` dual-write** in the OAuth authorize
route — callback's fallback masked it but the dual-write was specified
by the plan.
- Plus: `mcp.test.ts` tool-list assertions updated to include
`ask_hexclave`; two dashboard header-emit sites switched to
`x-hexclave-*` for consistency.
- **E2E snapshot serializer follow-up** (`4b16cc5d`) —
`x-hexclave-request-id` added to the hidden-headers list (mirroring
`x-stack-request-id` treatment), and 2 sample inline snapshots
regenerated in `projects.test.ts` to include the new dual-emitted
headers.

## Verification

- **`pnpm typecheck`** — clean (the fresh-worktree `@/.source` / Prisma
codegen gap in `stack-docs` is pre-existing and unrelated).
- **`pnpm lint`** — 29/29 packages green.
- **`pnpm exec turbo run build --filter=./packages/*`** — 13/13 packages
build (including `@stackframe/stack-cli` once the dashboard standalone
is present).
- **Live E2E** against a running backend on `cl/hexclave-pr1`:
- `pnpm test run
apps/e2e/tests/backend/endpoints/api/v1/internal/mcp.test.ts` — **6/6
pass** (verifies the new `ask_hexclave` tool — the hand-written inline
snapshot matched actual MCP server output).
- `pnpm test run
apps/e2e/tests/backend/endpoints/api/v1/internal/projects.test.ts` —
**11/11 pass** (verifies wire dual-accept + dual-emit end-to-end; the
snapshot serializer fix was found and applied during this check).

A four-agent parallel **review pass** also audited the full diff for
logic/runtime bugs across the work-areas (wire headers + JWT, cookies +
bearer + symbols, env vars, query params + config + MCP + aliases). All
in-slice review verdicts were ✓ except the three bugs listed above,
which are now fixed.

## Known follow-ups (out of scope for this PR)

- **E2E snapshots across the rest of the suite** — backend now
dual-emits `x-hexclave-{known-error,actual-status}` alongside
`x-stack-*`, which legitimately appears in inline snapshots throughout
`apps/e2e`. Two were regenerated here as a sample; the rest should regen
with `vitest -u` in CI.
- **Docker shell env vars beyond `PORT_PREFIX`** — `entrypoint.sh` still
reads `STACK_*` env vars directly (the JS-side `getEnvVariable`
transform doesn't help the shell). JS consumers dual-read so it works in
practice; full shell-level dual-read is a deeper self-host follow-up.
- **`@stackframe/stack-cli` build ordering** — pre-existing; needs
`build:rde-standalone` first. Not affected by this PR.

## Test plan

- [ ] CI runs full e2e suite (with `vitest -u` to absorb dual-emit
snapshot deltas, then committed back)
- [ ] Spot-check: an old SDK build (emitting only `x-stack-*`) still
authenticates against the new backend
- [ ] Spot-check: a new SDK (emitting `x-hexclave-*` / `Bearer
hexclave_*`) still authenticates against an old backend during deploy
ordering
- [ ] Manual: `npx @stackframe/stack-cli@latest init` (new onboarding
entrypoint) generates `hexclave.config.ts`
- [ ] Manual: existing `stack.config.ts`-only project still resolves (no
migration required)

---------

Co-authored-by: bilal <bilal@stack-auth.com>
2026-05-23 17:24:55 -07:00

11593 lines
433 KiB
JSON

{
"openapi": "3.1.0",
"info": {
"title": "Stack REST API",
"version": "1.0.0"
},
"servers": [
{
"url": "https://api.stack-auth.com/api/v1",
"description": "Stack REST API"
}
],
"paths": {
"/": {
"get": {
"summary": "/api/v1",
"description": "Returns a human-readable message with some useful information about the API.",
"parameters": [
{
"name": "X-Stack-Project-Id",
"in": "header",
"schema": {
"type": "string",
"example": "e0b52f4d-dece-408c-af49-d23061bb0f8d",
"description": "The unique identifier of the project"
},
"description": "The unique identifier of the project",
"example": "e0b52f4d-dece-408c-af49-d23061bb0f8d",
"required": false
},
{
"name": "X-Stack-Branch-Id",
"in": "header",
"schema": {
"type": "string",
"example": "e0b52f4d-dece-408c-af49-d23061bb0f8d",
"description": "The unique identifier of the project"
},
"description": "The unique identifier of the project",
"example": "e0b52f4d-dece-408c-af49-d23061bb0f8d",
"required": false
},
{
"name": "X-Stack-Access-Type",
"in": "header",
"schema": {
"type": "string",
"enum": [
"client",
"server",
"admin"
]
},
"required": false
},
{
"name": "X-Stack-Access-Token",
"in": "header",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "X-Stack-Refresh-Token",
"in": "header",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "X-Stack-Publishable-Client-Key",
"in": "header",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "X-Stack-Secret-Server-Key",
"in": "header",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "X-Stack-Super-Secret-Admin-Key",
"in": "header",
"schema": {
"type": "string"
},
"required": false
}
],
"tags": [],
"x-full-url": "https://api.stack-auth.com/api/v1/",
"responses": {
"200": {
"description": "Successful response",
"content": {
"text/plain": {
"schema": {
"type": "string",
"example": "Welcome to the Stack API endpoint! Please refer to the documentation at https://docs.stack-auth.com/\n\nAuthentication: None"
}
}
}
}
}
}
},
"/auth/anonymous/sign-up": {
"post": {
"summary": "Sign up anonymously",
"description": "Create a new anonymous account with no email",
"parameters": [],
"tags": [
"Anonymous"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/anonymous/sign-up",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
},
"refresh_token": {
"type": "string"
},
"user_id": {
"type": "string"
}
},
"required": [
"access_token",
"refresh_token",
"user_id"
]
}
}
}
}
}
}
},
"/team-api-keys": {
"get": {
"summary": "List team API keys",
"description": "List all team API keys for the project with their metadata and status",
"parameters": [
{
"name": "team_id",
"in": "query",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"API Keys"
],
"x-full-url": "https://api.stack-auth.com/api/v1/team-api-keys",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"description": {
"type": "string"
},
"expires_at_millis": {
"type": "number"
},
"manually_revoked_at_millis": {
"type": "number"
},
"created_at_millis": {
"type": "number"
},
"is_public": {
"type": "boolean"
},
"value": {
"type": "object",
"properties": {
"last_four": {
"type": "string"
}
},
"required": [
"last_four"
]
},
"type": {
"type": "string",
"enum": [
"team"
]
},
"team_id": {
"type": "string"
}
},
"required": [
"id",
"description",
"created_at_millis",
"is_public",
"value",
"type",
"team_id"
]
}
},
"pagination": {
"type": "object",
"properties": {
"next_cursor": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The cursor to fetch the next page of results. null if there is no next page."
}
},
"required": []
}
},
"required": [
"items"
]
}
}
}
}
}
},
"post": {
"summary": "Create team API key",
"description": "Create a new API key for a user or team",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"expires_at_millis": {
"type": "number"
},
"is_public": {
"type": "boolean"
},
"team_id": {
"type": "string"
}
},
"required": [
"description",
"team_id"
],
"example": {}
}
}
}
},
"tags": [
"API Keys"
],
"x-full-url": "https://api.stack-auth.com/api/v1/team-api-keys",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"value": {
"type": "string"
},
"id": {
"type": "string"
},
"description": {
"type": "string"
},
"expires_at_millis": {
"type": "number"
},
"manually_revoked_at_millis": {
"type": "number"
},
"created_at_millis": {
"type": "number"
},
"is_public": {
"type": "boolean"
},
"type": {
"type": "string",
"enum": [
"team"
]
},
"team_id": {
"type": "string"
}
},
"required": [
"value",
"id",
"description",
"created_at_millis",
"is_public",
"type",
"team_id"
]
}
}
}
}
}
}
},
"/team-api-keys/check": {
"post": {
"summary": "Check team API key validity",
"description": "Validate a team API key",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"api_key": {
"type": "string"
}
},
"required": [
"api_key"
],
"example": {}
}
}
}
},
"tags": [
"API Keys"
],
"x-full-url": "https://api.stack-auth.com/api/v1/team-api-keys/check",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"description": {
"type": "string"
},
"expires_at_millis": {
"type": "number"
},
"manually_revoked_at_millis": {
"type": "number"
},
"created_at_millis": {
"type": "number"
},
"is_public": {
"type": "boolean"
},
"value": {
"type": "object",
"properties": {
"last_four": {
"type": "string"
}
},
"required": [
"last_four"
]
},
"type": {
"type": "string",
"enum": [
"team"
]
},
"team_id": {
"type": "string"
}
},
"required": [
"id",
"description",
"created_at_millis",
"is_public",
"value",
"type",
"team_id"
]
}
}
}
}
}
}
},
"/team-api-keys/{api_key_id}": {
"get": {
"summary": "Get team API key details",
"description": "Get details of a specific team API key",
"parameters": [
{
"name": "api_key_id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"API Keys"
],
"x-full-url": "https://api.stack-auth.com/api/v1/team-api-keys/{api_key_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"description": {
"type": "string"
},
"expires_at_millis": {
"type": "number"
},
"manually_revoked_at_millis": {
"type": "number"
},
"created_at_millis": {
"type": "number"
},
"is_public": {
"type": "boolean"
},
"value": {
"type": "object",
"properties": {
"last_four": {
"type": "string"
}
},
"required": [
"last_four"
]
},
"type": {
"type": "string",
"enum": [
"team"
]
},
"team_id": {
"type": "string"
}
},
"required": [
"id",
"description",
"created_at_millis",
"is_public",
"value",
"type",
"team_id"
]
}
}
}
}
}
},
"patch": {
"summary": "Update team API key",
"description": "Update an team API key",
"parameters": [
{
"name": "api_key_id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"revoked": {
"type": "boolean"
}
},
"example": {}
}
}
}
},
"tags": [
"API Keys"
],
"x-full-url": "https://api.stack-auth.com/api/v1/team-api-keys/{api_key_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"description": {
"type": "string"
},
"expires_at_millis": {
"type": "number"
},
"manually_revoked_at_millis": {
"type": "number"
},
"created_at_millis": {
"type": "number"
},
"is_public": {
"type": "boolean"
},
"value": {
"type": "object",
"properties": {
"last_four": {
"type": "string"
}
},
"required": [
"last_four"
]
},
"type": {
"type": "string",
"enum": [
"team"
]
},
"team_id": {
"type": "string"
}
},
"required": [
"id",
"description",
"created_at_millis",
"is_public",
"value",
"type",
"team_id"
]
}
}
}
}
}
}
},
"/user-api-keys": {
"get": {
"summary": "List user API keys",
"description": "List all user API keys for the project with their metadata and status",
"parameters": [
{
"name": "user_id",
"in": "query",
"schema": {
"type": "string"
},
"required": false
}
],
"tags": [
"API Keys"
],
"x-full-url": "https://api.stack-auth.com/api/v1/user-api-keys",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"description": {
"type": "string"
},
"expires_at_millis": {
"type": "number"
},
"manually_revoked_at_millis": {
"type": "number"
},
"created_at_millis": {
"type": "number"
},
"is_public": {
"type": "boolean"
},
"value": {
"type": "object",
"properties": {
"last_four": {
"type": "string"
}
},
"required": [
"last_four"
]
},
"type": {
"type": "string",
"enum": [
"user"
]
},
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
}
},
"required": [
"id",
"description",
"created_at_millis",
"is_public",
"value",
"type",
"user_id"
]
}
},
"pagination": {
"type": "object",
"properties": {
"next_cursor": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The cursor to fetch the next page of results. null if there is no next page."
}
},
"required": []
}
},
"required": [
"items"
]
}
}
}
}
}
},
"post": {
"summary": "Create user API key",
"description": "Create a new API key for a user or team",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"expires_at_millis": {
"type": "number"
},
"is_public": {
"type": "boolean"
},
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
}
},
"required": [
"description",
"user_id"
],
"example": {
"user_id": "3241a285-8329-4d69-8f3d-316e08cf140c"
}
}
}
}
},
"tags": [
"API Keys"
],
"x-full-url": "https://api.stack-auth.com/api/v1/user-api-keys",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"value": {
"type": "string"
},
"id": {
"type": "string"
},
"description": {
"type": "string"
},
"expires_at_millis": {
"type": "number"
},
"manually_revoked_at_millis": {
"type": "number"
},
"created_at_millis": {
"type": "number"
},
"is_public": {
"type": "boolean"
},
"type": {
"type": "string",
"enum": [
"user"
]
},
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
}
},
"required": [
"value",
"id",
"description",
"created_at_millis",
"is_public",
"type",
"user_id"
]
}
}
}
}
}
}
},
"/user-api-keys/check": {
"post": {
"summary": "Check user API key validity",
"description": "Validate a user API key",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"api_key": {
"type": "string"
}
},
"required": [
"api_key"
],
"example": {}
}
}
}
},
"tags": [
"API Keys"
],
"x-full-url": "https://api.stack-auth.com/api/v1/user-api-keys/check",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"description": {
"type": "string"
},
"expires_at_millis": {
"type": "number"
},
"manually_revoked_at_millis": {
"type": "number"
},
"created_at_millis": {
"type": "number"
},
"is_public": {
"type": "boolean"
},
"value": {
"type": "object",
"properties": {
"last_four": {
"type": "string"
}
},
"required": [
"last_four"
]
},
"type": {
"type": "string",
"enum": [
"user"
]
},
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
}
},
"required": [
"id",
"description",
"created_at_millis",
"is_public",
"value",
"type",
"user_id"
]
}
}
}
}
}
}
},
"/user-api-keys/{api_key_id}": {
"get": {
"summary": "Get user API key details",
"description": "Get details of a specific user API key",
"parameters": [
{
"name": "api_key_id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"API Keys"
],
"x-full-url": "https://api.stack-auth.com/api/v1/user-api-keys/{api_key_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"description": {
"type": "string"
},
"expires_at_millis": {
"type": "number"
},
"manually_revoked_at_millis": {
"type": "number"
},
"created_at_millis": {
"type": "number"
},
"is_public": {
"type": "boolean"
},
"value": {
"type": "object",
"properties": {
"last_four": {
"type": "string"
}
},
"required": [
"last_four"
]
},
"type": {
"type": "string",
"enum": [
"user"
]
},
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
}
},
"required": [
"id",
"description",
"created_at_millis",
"is_public",
"value",
"type",
"user_id"
]
}
}
}
}
}
},
"patch": {
"summary": "Update user API key",
"description": "Update an user API key",
"parameters": [
{
"name": "api_key_id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"revoked": {
"type": "boolean"
}
},
"example": {}
}
}
}
},
"tags": [
"API Keys"
],
"x-full-url": "https://api.stack-auth.com/api/v1/user-api-keys/{api_key_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"description": {
"type": "string"
},
"expires_at_millis": {
"type": "number"
},
"manually_revoked_at_millis": {
"type": "number"
},
"created_at_millis": {
"type": "number"
},
"is_public": {
"type": "boolean"
},
"value": {
"type": "object",
"properties": {
"last_four": {
"type": "string"
}
},
"required": [
"last_four"
]
},
"type": {
"type": "string",
"enum": [
"user"
]
},
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
}
},
"required": [
"id",
"description",
"created_at_millis",
"is_public",
"value",
"type",
"user_id"
]
}
}
}
}
}
}
},
"/auth/cli": {
"post": {
"summary": "Initiate CLI authentication",
"description": "Create a new CLI authentication session and return polling and login codes",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"expires_in_millis": {
"type": "number",
"default": 120000
},
"anon_refresh_token": {
"type": "string"
}
},
"example": {}
}
}
}
},
"tags": [
"CLI Authentication"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/cli",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"polling_code": {
"type": "string"
},
"login_code": {
"type": "string"
},
"expires_at": {
"type": "string"
}
},
"required": [
"polling_code",
"login_code",
"expires_at"
]
}
}
}
}
}
}
},
"/auth/cli/complete": {
"post": {
"summary": "Complete CLI authentication",
"description": "Inspect, claim, or complete a CLI authentication session",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"login_code": {
"type": "string"
},
"mode": {
"type": "string",
"enum": [
"check",
"claim-anon-session",
"complete"
],
"default": "complete"
},
"refresh_token": {
"type": "string"
}
},
"required": [
"login_code"
],
"example": {}
}
}
}
},
"tags": [
"CLI Authentication"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/cli/complete",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
},
"required": [
"success"
]
}
}
}
}
}
}
},
"/auth/cli/poll": {
"post": {
"summary": "Poll CLI authentication status",
"description": "Check the status of a CLI authentication session using the polling code",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"polling_code": {
"type": "string"
}
},
"required": [
"polling_code"
],
"example": {}
}
}
}
},
"tags": [
"CLI Authentication"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/cli/poll",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"waiting",
"success",
"expired",
"used"
]
},
"refresh_token": {
"type": "string"
}
},
"required": [
"status"
]
}
}
}
},
"201": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"waiting",
"success",
"expired",
"used"
]
},
"refresh_token": {
"type": "string"
}
},
"required": [
"status"
]
}
}
}
}
}
}
},
"/connected-accounts/{user_id}": {
"get": {
"summary": "List connected accounts",
"description": "Retrieves a list of all connected accounts for a user.",
"parameters": [
{
"name": "user_id",
"in": "path",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": false
}
],
"tags": [
"Connected Accounts"
],
"x-full-url": "https://api.stack-auth.com/api/v1/connected-accounts/{user_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"provider": {
"type": "string",
"example": "google",
"description": "Provider config ID of the OAuth provider. This uniquely identifies the provider config on config.json file"
},
"provider_account_id": {
"type": "string",
"example": "google-account-id-12345",
"description": "Account ID of the OAuth provider. This uniquely identifies the account on the provider side."
}
},
"required": [
"user_id",
"provider",
"provider_account_id"
]
}
},
"pagination": {
"type": "object",
"properties": {
"next_cursor": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The cursor to fetch the next page of results. null if there is no next page."
}
},
"required": []
}
},
"required": [
"items"
]
}
}
}
}
}
}
},
"/contact-channels": {
"get": {
"summary": "List contact channels",
"description": "Retrieves a list of all contact channels for a user.",
"parameters": [
{
"name": "user_id",
"in": "query",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": false
},
{
"name": "contact_channel_id",
"in": "query",
"schema": {
"type": "string"
},
"required": false
}
],
"tags": [
"Contact Channels"
],
"x-full-url": "https://api.stack-auth.com/api/v1/contact-channels",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
},
"id": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The unique identifier of the contact channel"
},
"value": {
"type": "string",
"example": "johndoe@example.com",
"description": "The value of the contact channel. For email, this should be a valid email address."
},
"type": {
"type": "string",
"enum": [
"email"
],
"example": "email",
"description": "The type of the contact channel. Currently only \"email\" is supported."
},
"used_for_auth": {
"type": "boolean",
"example": true,
"description": "Whether the contact channel is used for authentication. If this is set to `true`, the user will be able to sign in with the contact channel with password or OTP."
},
"is_verified": {
"type": "boolean",
"example": true,
"description": "Whether the contact channel has been verified. If this is set to `true`, the contact channel has been verified to belong to the user."
},
"is_primary": {
"type": "boolean",
"example": true,
"description": "Whether the contact channel is the primary contact channel. If this is set to `true`, it will be used for authentication and notifications by default."
}
},
"required": [
"user_id",
"id",
"value",
"type",
"used_for_auth",
"is_verified",
"is_primary"
]
}
},
"pagination": {
"type": "object",
"properties": {
"next_cursor": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The cursor to fetch the next page of results. null if there is no next page."
}
},
"required": []
}
},
"required": [
"items"
]
}
}
}
}
}
},
"post": {
"summary": "Create a contact channel",
"description": "Add a new contact channel for a user.",
"parameters": [
{
"name": "user_id",
"in": "query",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": false
},
{
"name": "contact_channel_id",
"in": "query",
"schema": {
"type": "string"
},
"required": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"is_verified": {
"type": "boolean",
"example": true,
"description": "Whether the contact channel has been verified. If this is set to `true`, the contact channel has been verified to belong to the user."
},
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"value": {
"type": "string",
"example": "johndoe@example.com",
"description": "The value of the contact channel. For email, this should be a valid email address."
},
"type": {
"type": "string",
"enum": [
"email"
],
"example": "email",
"description": "The type of the contact channel. Currently only \"email\" is supported."
},
"used_for_auth": {
"type": "boolean",
"example": true,
"description": "Whether the contact channel is used for authentication. If this is set to `true`, the user will be able to sign in with the contact channel with password or OTP."
},
"is_primary": {
"type": "boolean",
"example": true,
"description": "Whether the contact channel is the primary contact channel. If this is set to `true`, it will be used for authentication and notifications by default."
}
},
"required": [
"user_id",
"value",
"type",
"used_for_auth"
],
"example": {
"is_verified": true,
"user_id": "3241a285-8329-4d69-8f3d-316e08cf140c",
"value": "johndoe@example.com",
"type": "email",
"used_for_auth": true,
"is_primary": true
}
}
}
}
},
"tags": [
"Contact Channels"
],
"x-full-url": "https://api.stack-auth.com/api/v1/contact-channels",
"responses": {
"201": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
},
"id": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The unique identifier of the contact channel"
},
"value": {
"type": "string",
"example": "johndoe@example.com",
"description": "The value of the contact channel. For email, this should be a valid email address."
},
"type": {
"type": "string",
"enum": [
"email"
],
"example": "email",
"description": "The type of the contact channel. Currently only \"email\" is supported."
},
"used_for_auth": {
"type": "boolean",
"example": true,
"description": "Whether the contact channel is used for authentication. If this is set to `true`, the user will be able to sign in with the contact channel with password or OTP."
},
"is_verified": {
"type": "boolean",
"example": true,
"description": "Whether the contact channel has been verified. If this is set to `true`, the contact channel has been verified to belong to the user."
},
"is_primary": {
"type": "boolean",
"example": true,
"description": "Whether the contact channel is the primary contact channel. If this is set to `true`, it will be used for authentication and notifications by default."
}
},
"required": [
"user_id",
"id",
"value",
"type",
"used_for_auth",
"is_verified",
"is_primary"
]
}
}
}
}
}
}
},
"/contact-channels/verify": {
"post": {
"summary": "Verify an email",
"description": "Verify an email address of a user",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2",
"description": "A 45 character code"
}
},
"required": [
"code"
],
"example": {
"code": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2"
}
}
}
}
},
"tags": [
"Contact Channels"
],
"x-full-url": "https://api.stack-auth.com/api/v1/contact-channels/verify",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "Always equal to true.",
"example": true
}
},
"required": [
"success"
]
}
}
}
}
}
}
},
"/contact-channels/verify/check-code": {
"post": {
"summary": "Check email verification code",
"description": "Check if an email verification code is valid without using it",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2",
"description": "A 45 character code"
}
},
"required": [
"code"
],
"example": {
"code": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2"
}
}
}
}
},
"tags": [
"Contact Channels"
],
"x-full-url": "https://api.stack-auth.com/api/v1/contact-channels/verify/check-code",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"is_code_valid": {
"type": "boolean"
}
},
"required": [
"is_code_valid"
]
}
}
}
}
}
}
},
"/contact-channels/{user_id}/{contact_channel_id}": {
"get": {
"summary": "Get a contact channel",
"description": "Retrieves a specific contact channel by the user ID and the contact channel ID.",
"parameters": [
{
"name": "user_id",
"in": "query",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": false
},
{
"name": "contact_channel_id",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "user_id",
"in": "path",
"schema": {
"type": "string",
"example": "me",
"description": "the user that the contact channel belongs to"
},
"description": "the user that the contact channel belongs to",
"required": true
},
{
"name": "contact_channel_id",
"in": "path",
"schema": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "the target contact channel"
},
"description": "the target contact channel",
"required": true
}
],
"tags": [
"Contact Channels"
],
"x-full-url": "https://api.stack-auth.com/api/v1/contact-channels/{user_id}/{contact_channel_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
},
"id": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The unique identifier of the contact channel"
},
"value": {
"type": "string",
"example": "johndoe@example.com",
"description": "The value of the contact channel. For email, this should be a valid email address."
},
"type": {
"type": "string",
"enum": [
"email"
],
"example": "email",
"description": "The type of the contact channel. Currently only \"email\" is supported."
},
"used_for_auth": {
"type": "boolean",
"example": true,
"description": "Whether the contact channel is used for authentication. If this is set to `true`, the user will be able to sign in with the contact channel with password or OTP."
},
"is_verified": {
"type": "boolean",
"example": true,
"description": "Whether the contact channel has been verified. If this is set to `true`, the contact channel has been verified to belong to the user."
},
"is_primary": {
"type": "boolean",
"example": true,
"description": "Whether the contact channel is the primary contact channel. If this is set to `true`, it will be used for authentication and notifications by default."
}
},
"required": [
"user_id",
"id",
"value",
"type",
"used_for_auth",
"is_verified",
"is_primary"
]
}
}
}
}
}
},
"delete": {
"summary": "Delete a contact channel",
"description": "Removes a contact channel for a given user.",
"parameters": [
{
"name": "user_id",
"in": "query",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": false
},
{
"name": "contact_channel_id",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "user_id",
"in": "path",
"schema": {
"type": "string",
"example": "me",
"description": "the user that the contact channel belongs to"
},
"description": "the user that the contact channel belongs to",
"required": true
},
{
"name": "contact_channel_id",
"in": "path",
"schema": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "the target contact channel"
},
"description": "the target contact channel",
"required": true
}
],
"tags": [
"Contact Channels"
],
"x-full-url": "https://api.stack-auth.com/api/v1/contact-channels/{user_id}/{contact_channel_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "Always equal to true.",
"example": true
}
},
"required": [
"success"
]
}
}
}
}
}
},
"patch": {
"summary": "Update a contact channel",
"description": "Updates an existing contact channel. Only the values provided will be updated.",
"parameters": [
{
"name": "user_id",
"in": "query",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": false
},
{
"name": "contact_channel_id",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "user_id",
"in": "path",
"schema": {
"type": "string",
"example": "me",
"description": "the user that the contact channel belongs to"
},
"description": "the user that the contact channel belongs to",
"required": true
},
{
"name": "contact_channel_id",
"in": "path",
"schema": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "the target contact channel"
},
"description": "the target contact channel",
"required": true
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"is_verified": {
"type": "boolean",
"example": true,
"description": "Whether the contact channel has been verified. If this is set to `true`, the contact channel has been verified to belong to the user."
},
"value": {
"type": "string",
"example": "johndoe@example.com",
"description": "The value of the contact channel. For email, this should be a valid email address."
},
"type": {
"type": "string",
"enum": [
"email"
],
"example": "email",
"description": "The type of the contact channel. Currently only \"email\" is supported."
},
"used_for_auth": {
"type": "boolean",
"example": true,
"description": "Whether the contact channel is used for authentication. If this is set to `true`, the user will be able to sign in with the contact channel with password or OTP."
},
"is_primary": {
"type": "boolean",
"example": true,
"description": "Whether the contact channel is the primary contact channel. If this is set to `true`, it will be used for authentication and notifications by default."
}
},
"example": {
"is_verified": true,
"value": "johndoe@example.com",
"type": "email",
"used_for_auth": true,
"is_primary": true
}
}
}
}
},
"tags": [
"Contact Channels"
],
"x-full-url": "https://api.stack-auth.com/api/v1/contact-channels/{user_id}/{contact_channel_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
},
"id": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The unique identifier of the contact channel"
},
"value": {
"type": "string",
"example": "johndoe@example.com",
"description": "The value of the contact channel. For email, this should be a valid email address."
},
"type": {
"type": "string",
"enum": [
"email"
],
"example": "email",
"description": "The type of the contact channel. Currently only \"email\" is supported."
},
"used_for_auth": {
"type": "boolean",
"example": true,
"description": "Whether the contact channel is used for authentication. If this is set to `true`, the user will be able to sign in with the contact channel with password or OTP."
},
"is_verified": {
"type": "boolean",
"example": true,
"description": "Whether the contact channel has been verified. If this is set to `true`, the contact channel has been verified to belong to the user."
},
"is_primary": {
"type": "boolean",
"example": true,
"description": "Whether the contact channel is the primary contact channel. If this is set to `true`, it will be used for authentication and notifications by default."
}
},
"required": [
"user_id",
"id",
"value",
"type",
"used_for_auth",
"is_verified",
"is_primary"
]
}
}
}
}
}
}
},
"/contact-channels/{user_id}/{contact_channel_id}/send-verification-code": {
"post": {
"summary": "Send contact channel verification code",
"description": "Send a code to the user's contact channel for verifying the contact channel.",
"parameters": [
{
"name": "user_id",
"in": "path",
"schema": {
"type": "string",
"example": "me",
"description": "The user to send the verification code to."
},
"description": "The user to send the verification code to.",
"required": true
},
{
"name": "contact_channel_id",
"in": "path",
"schema": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The contact channel to send the verification code to."
},
"description": "The contact channel to send the verification code to.",
"required": true
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"callback_url": {
"type": "string",
"example": "https://example.com/handler/email-verification",
"description": "The base callback URL to construct a verification link for the verification e-mail. A query parameter `code` with the verification code will be appended to it. The page should then make a request to the `/contact-channels/verify` endpoint."
}
},
"required": [
"callback_url"
],
"example": {
"callback_url": "https://example.com/handler/email-verification"
}
}
}
}
},
"tags": [
"Contact Channels"
],
"x-full-url": "https://api.stack-auth.com/api/v1/contact-channels/{user_id}/{contact_channel_id}/send-verification-code",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "Always equal to true.",
"example": true
}
},
"required": [
"success"
]
}
}
}
}
}
}
},
"/data-vault/stores/{id}/get": {
"post": {
"summary": "Retrieve encrypted value from data vault",
"description": "Retrieves and decrypts a value from the data vault using a hashed key",
"parameters": [
{
"name": "id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"hashed_key": {
"type": "string"
}
},
"required": [
"hashed_key"
],
"example": {}
}
}
}
},
"tags": [
"DataVault"
],
"x-full-url": "https://api.stack-auth.com/api/v1/data-vault/stores/{id}/get",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"encrypted_value": {
"type": "string"
}
},
"required": [
"encrypted_value"
]
}
}
}
}
}
}
},
"/data-vault/stores/{id}/set": {
"post": {
"summary": "Store encrypted value in data vault",
"description": "Stores a hashed key and encrypted value in the data vault for a specific store",
"parameters": [
{
"name": "id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"hashed_key": {
"type": "string"
},
"encrypted_value": {
"type": "string"
}
},
"required": [
"hashed_key",
"encrypted_value"
],
"example": {}
}
}
}
},
"tags": [
"DataVault"
],
"x-full-url": "https://api.stack-auth.com/api/v1/data-vault/stores/{id}/set",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "Always equal to true.",
"example": true
}
},
"required": [
"success"
]
}
}
}
}
}
}
},
"/emails/capacity-boost": {
"post": {
"summary": "Activate email capacity boost",
"description": "Temporarily increases email capacity by 4x for 4 hours.",
"parameters": [],
"tags": [
"Emails"
],
"x-full-url": "https://api.stack-auth.com/api/v1/emails/capacity-boost",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"expires_at": {
"type": "string"
}
},
"required": [
"expires_at"
]
}
}
}
}
}
}
},
"/emails/delivery-info": {
"get": {
"summary": "Get email delivery info",
"description": "Returns delivery statistics and capacity information for the current tenancy.",
"parameters": [],
"tags": [
"Emails"
],
"x-full-url": "https://api.stack-auth.com/api/v1/emails/delivery-info",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"stats": {
"type": "object",
"properties": {
"hour": {
"type": "object",
"properties": {
"sent": {
"type": "number"
},
"bounced": {
"type": "number"
},
"marked_as_spam": {
"type": "number"
}
},
"required": [
"sent",
"bounced",
"marked_as_spam"
]
},
"day": {
"type": "object",
"properties": {
"sent": {
"type": "number"
},
"bounced": {
"type": "number"
},
"marked_as_spam": {
"type": "number"
}
},
"required": [
"sent",
"bounced",
"marked_as_spam"
]
},
"week": {
"type": "object",
"properties": {
"sent": {
"type": "number"
},
"bounced": {
"type": "number"
},
"marked_as_spam": {
"type": "number"
}
},
"required": [
"sent",
"bounced",
"marked_as_spam"
]
},
"month": {
"type": "object",
"properties": {
"sent": {
"type": "number"
},
"bounced": {
"type": "number"
},
"marked_as_spam": {
"type": "number"
}
},
"required": [
"sent",
"bounced",
"marked_as_spam"
]
}
},
"required": [
"hour",
"day",
"week",
"month"
]
},
"capacity": {
"type": "object",
"properties": {
"rate_per_second": {
"type": "number"
},
"boost_multiplier": {
"type": "number"
},
"penalty_factor": {
"type": "number"
},
"is_boost_active": {
"type": "boolean"
},
"boost_expires_at": {
"type": "string"
}
},
"required": [
"rate_per_second",
"boost_multiplier",
"penalty_factor",
"is_boost_active"
]
}
},
"required": [
"stats",
"capacity"
]
}
}
}
}
}
}
},
"/emails/notification-preference/{user_id}": {
"get": {
"summary": "List notification preferences",
"description": "Get all notification preferences for a user, showing which notification categories are enabled or disabled.",
"parameters": [
{
"name": "user_id",
"in": "path",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": false
}
],
"tags": [
"Emails"
],
"x-full-url": "https://api.stack-auth.com/api/v1/emails/notification-preference/{user_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"notification_category_id": {
"type": "string"
},
"notification_category_name": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"can_disable": {
"type": "boolean"
}
},
"required": [
"notification_category_id",
"notification_category_name",
"enabled",
"can_disable"
]
}
},
"pagination": {
"type": "object",
"properties": {
"next_cursor": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The cursor to fetch the next page of results. null if there is no next page."
}
},
"required": []
}
},
"required": [
"items"
]
}
}
}
}
}
}
},
"/emails/notification-preference/{user_id}/{notification_category_id}": {
"patch": {
"summary": "Update notification preference",
"description": "Enable or disable a specific notification category for a user.",
"parameters": [
{
"name": "user_id",
"in": "path",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": true
},
{
"name": "notification_category_id",
"in": "path",
"schema": {
"type": "string"
},
"required": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
}
},
"required": [
"enabled"
],
"example": {}
}
}
}
},
"tags": [
"Emails"
],
"x-full-url": "https://api.stack-auth.com/api/v1/emails/notification-preference/{user_id}/{notification_category_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"notification_category_id": {
"type": "string"
},
"notification_category_name": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"can_disable": {
"type": "boolean"
}
},
"required": [
"notification_category_id",
"notification_category_name",
"enabled",
"can_disable"
]
}
}
}
}
}
}
},
"/emails/outbox": {
"get": {
"summary": "List email outbox",
"description": "Lists all emails in the outbox with optional filtering by status or simple_status.",
"parameters": [
{
"name": "status",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "simple_status",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "limit",
"in": "query",
"schema": {
"type": "string",
"description": "The maximum number of items to return. Maximum allowed is 100"
},
"description": "The maximum number of items to return. Maximum allowed is 100",
"required": false
},
{
"name": "cursor",
"in": "query",
"schema": {
"type": "string",
"description": "The cursor to start the result set from (email ID)"
},
"description": "The cursor to start the result set from (email ID)",
"required": false
}
],
"tags": [
"Emails"
],
"x-full-url": "https://api.stack-auth.com/api/v1/emails/outbox",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object"
}
},
"pagination": {
"type": "object",
"properties": {
"next_cursor": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The cursor to fetch the next page of results. null if there is no next page."
}
},
"required": []
}
},
"required": [
"items"
]
}
}
}
}
}
}
},
"/emails/outbox/{id}": {
"get": {
"summary": "Get email outbox entry",
"description": "Gets a single email from the outbox by ID.",
"parameters": [
{
"name": "status",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "simple_status",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "id",
"in": "path",
"schema": {
"type": "string"
},
"required": false
}
],
"tags": [
"Emails"
],
"x-full-url": "https://api.stack-auth.com/api/v1/emails/outbox/{id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {}
}
}
}
}
},
"patch": {
"summary": "Update email outbox entry",
"description": "Updates an email in the outbox. Can be used to edit email content, pause/resume, or cancel emails. Only emails in editable states (`paused`, `preparing`, `rendering`, `render-error`, `scheduled`, `queued`, `server-error`) can be modified.",
"parameters": [
{
"name": "status",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "simple_status",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "id",
"in": "path",
"schema": {
"type": "string"
},
"required": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"tsx_source": {
"type": "string"
},
"theme_id": {
"type": "string"
},
"to": {
"type": "object"
},
"variables": {
"type": "object",
"properties": {},
"required": []
},
"skip_deliverability_check": {
"type": "boolean"
},
"scheduled_at_millis": {
"type": "number"
},
"is_paused": {
"type": "boolean"
},
"cancel": {
"type": "boolean"
}
},
"example": {}
}
}
}
},
"tags": [
"Emails"
],
"x-full-url": "https://api.stack-auth.com/api/v1/emails/outbox/{id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {}
}
}
}
}
}
},
"/emails/send-email": {
"post": {
"summary": "Send email",
"description": "Send an email to a list of users. The content field should contain either {html} for HTML emails, {template_id, variables} for template-based emails, or {draft_id} for a draft email.",
"parameters": [],
"tags": [
"Emails"
],
"x-full-url": "https://api.stack-auth.com/api/v1/emails/send-email",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"results": {
"type": "array",
"items": {
"type": "object",
"properties": {
"user_id": {
"type": "string"
}
},
"required": [
"user_id"
]
}
}
},
"required": [
"results"
]
}
}
}
}
}
}
},
"/internal/feature-requests": {
"get": {
"summary": "Get feature requests",
"description": "Fetch all feature requests with upvote status for the current user",
"parameters": [],
"tags": [
"Internal"
],
"x-full-url": "https://api.stack-auth.com/api/v1/internal/feature-requests",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"posts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"content": {
"type": "string"
},
"upvotes": {
"type": "number"
},
"date": {
"type": "string"
},
"postStatus": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"color": {
"type": "string"
}
},
"required": [
"name",
"color"
]
},
"userHasUpvoted": {
"type": "boolean"
}
},
"required": [
"id",
"title",
"upvotes",
"date",
"userHasUpvoted"
]
}
}
},
"required": [
"posts"
]
}
}
}
}
}
},
"post": {
"summary": "Create feature request",
"description": "Create a new feature request",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"content": {
"type": "string"
},
"category": {
"type": "string"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"commentsAllowed": {
"type": "boolean"
},
"customInputValues": {
"type": "object",
"properties": {},
"required": []
}
},
"required": [
"title"
],
"example": {}
}
}
}
},
"tags": [
"Internal"
],
"x-full-url": "https://api.stack-auth.com/api/v1/internal/feature-requests",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"id": {
"type": "string"
}
},
"required": [
"success"
]
}
}
}
}
}
}
},
"/internal/feature-requests/{featureRequestId}/upvote": {
"post": {
"summary": "Toggle upvote on feature request",
"description": "Toggle upvote on a feature request for the current user",
"parameters": [
{
"name": "featureRequestId",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {},
"example": {}
}
}
}
},
"tags": [
"Internal"
],
"x-full-url": "https://api.stack-auth.com/api/v1/internal/feature-requests/{featureRequestId}/upvote",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"upvoted": {
"type": "boolean"
}
},
"required": [
"success"
]
}
}
}
}
}
}
},
"/internal/feedback": {
"post": {
"summary": "Submit support feedback",
"description": "Send a support feedback message to the internal Stack Auth inbox. Auth is optional — works from both the dashboard (authenticated) and the dev tool (unauthenticated).",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"email": {
"type": "string"
},
"message": {
"type": "string"
},
"feedback_type": {
"type": "string",
"enum": [
"feedback",
"bug"
]
}
},
"required": [
"email",
"message"
],
"example": {}
}
}
}
},
"tags": [
"Internal"
],
"x-full-url": "https://api.stack-auth.com/api/v1/internal/feedback",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
},
"required": [
"success"
]
}
}
}
}
}
}
},
"/internal/preview/create-project": {
"post": {
"summary": "Create a preview project",
"description": "Creates a new project pre-filled with dummy data for the preview environment. Only available when NEXT_PUBLIC_STACK_IS_PREVIEW=true.",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {},
"example": {}
}
}
}
},
"tags": [
"Internal"
],
"x-full-url": "https://api.stack-auth.com/api/v1/internal/preview/create-project",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"project_id": {
"type": "string"
}
},
"required": [
"project_id"
]
}
}
}
}
}
}
},
"/auth/oauth/authorize/{provider_id}": {
"get": {
"summary": "OAuth authorize endpoint",
"description": "This endpoint is used to initiate the OAuth authorization flow. there are two purposes for this endpoint: 1. Authenticate a user with an OAuth provider. 2. Link an existing user with an OAuth provider.",
"parameters": [
{
"name": "type",
"in": "query",
"schema": {
"type": "string",
"enum": [
"authenticate",
"link"
],
"default": "authenticate"
},
"required": false
},
{
"name": "token",
"in": "query",
"schema": {
"type": "string",
"default": ""
},
"required": false
},
{
"name": "provider_scope",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "error_redirect_uri",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "after_callback_redirect_url",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "stack_response_mode",
"in": "query",
"schema": {
"type": "string",
"enum": [
"json",
"redirect"
],
"description": "Response mode for the OAuth authorize endpoint. Defaults to 'redirect' if not provided."
},
"description": "Response mode for the OAuth authorize endpoint. Defaults to 'redirect' if not provided.",
"required": false
},
{
"name": "hexclave_response_mode",
"in": "query",
"schema": {
"type": "string",
"enum": [
"json",
"redirect"
],
"description": "Response mode for the OAuth authorize endpoint. Defaults to 'redirect' if not provided."
},
"description": "Response mode for the OAuth authorize endpoint. Defaults to 'redirect' if not provided.",
"required": false
},
{
"name": "bot_challenge_token",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "bot_challenge_phase",
"in": "query",
"schema": {
"type": "string",
"enum": [
"invisible",
"visible"
]
},
"required": false
},
{
"name": "bot_challenge_unavailable",
"in": "query",
"schema": {
"type": "string",
"enum": [
"true"
]
},
"required": false
},
{
"name": "client_id",
"in": "query",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "client_secret",
"in": "query",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "redirect_uri",
"in": "query",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "scope",
"in": "query",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "state",
"in": "query",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "grant_type",
"in": "query",
"schema": {
"type": "string",
"enum": [
"authorization_code"
]
},
"required": true
},
{
"name": "code_challenge",
"in": "query",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "code_challenge_method",
"in": "query",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "response_type",
"in": "query",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "provider_id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"Oauth"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/oauth/authorize/{provider_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"location": {
"type": "string"
}
},
"required": [
"location"
]
}
}
}
},
"307": {
"description": "Successful response",
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
}
}
}
}
},
"/auth/oauth/cross-domain/authorize": {
"post": {
"summary": "Create cross-domain auth handoff redirect",
"description": "Creates a one-time OAuth authorization code redirect for cross-domain sign-in handoff using PKCE.",
"parameters": [
{
"name": "x-stack-publishable-client-key",
"in": "header",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "x-stack-refresh-token",
"in": "header",
"schema": {
"type": "string"
},
"required": true
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"redirect_uri": {
"type": "string"
},
"state": {
"type": "string"
},
"code_challenge": {
"type": "string"
},
"code_challenge_method": {
"type": "string",
"enum": [
"S256"
],
"default": "S256"
},
"after_callback_redirect_url": {
"type": "string"
}
},
"required": [
"redirect_uri",
"state",
"code_challenge"
],
"example": {}
}
}
}
},
"tags": [
"Oauth"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/oauth/cross-domain/authorize",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"redirect_url": {
"type": "string"
}
},
"required": [
"redirect_url"
]
}
}
}
}
}
}
},
"/auth/oauth/token": {
"post": {
"summary": "OAuth token endpoints",
"description": "This endpoint is used to exchange an authorization code or refresh token for an access token.",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"grant_type": {
"type": "string",
"enum": [
"authorization_code",
"refresh_token"
]
},
"client_id": {
"type": "string"
},
"client_secret": {
"type": "string"
}
},
"required": [
"grant_type"
],
"example": {}
}
}
}
},
"tags": [
"Oauth"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/oauth/token",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {}
}
}
}
}
}
},
"/oauth-providers": {
"get": {
"summary": "List OAuth providers",
"description": "Retrieves a list of all OAuth providers for a user.",
"parameters": [
{
"name": "user_id",
"in": "query",
"schema": {
"type": "string"
},
"required": false
}
],
"tags": [
"Oauth"
],
"x-full-url": "https://api.stack-auth.com/api/v1/oauth-providers",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"account_id": {
"type": "string",
"example": "google-account-id-12345",
"description": "Account ID of the OAuth provider. This uniquely identifies the account on the provider side."
},
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"id": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The unique identifier of the OAuth provider"
},
"email": {
"type": "string",
"example": "test@gmail.com",
"description": "Email of the OAuth provider. This is used to display and identify the OAuth provider in the UI."
},
"provider_config_id": {
"type": "string",
"example": "google",
"description": "Provider config ID of the OAuth provider. This uniquely identifies the provider config on config.json file"
},
"type": {
"type": "string",
"enum": [
"google",
"github",
"microsoft",
"spotify",
"facebook",
"discord",
"gitlab",
"bitbucket",
"linkedin",
"apple",
"x",
"twitch"
],
"example": "google",
"description": "OAuth provider type, one of `google`, `github`, `microsoft`, `spotify`, `facebook`, `discord`, `gitlab`, `bitbucket`, `linkedin`, `apple`, `x`, `twitch`"
},
"allow_sign_in": {
"type": "boolean",
"example": true,
"description": "Whether the user can use this OAuth provider to sign in. Only one OAuth provider per type can have this set to `true`."
},
"allow_connected_accounts": {
"type": "boolean",
"example": true,
"description": "Whether the user can use this OAuth provider as connected account. Multiple OAuth providers per type can have this set to `true`."
}
},
"required": [
"account_id",
"user_id",
"id",
"provider_config_id",
"type",
"allow_sign_in",
"allow_connected_accounts"
]
}
},
"pagination": {
"type": "object",
"properties": {
"next_cursor": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The cursor to fetch the next page of results. null if there is no next page."
}
},
"required": []
}
},
"required": [
"items"
]
}
}
}
}
}
},
"post": {
"summary": "Create an OAuth provider",
"description": "Add a new OAuth provider for a user.",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"provider_config_id": {
"type": "string"
},
"email": {
"type": "string",
"example": "test@gmail.com",
"description": "Email of the OAuth provider. This is used to display and identify the OAuth provider in the UI."
},
"allow_sign_in": {
"type": "boolean",
"example": true,
"description": "Whether the user can use this OAuth provider to sign in. Only one OAuth provider per type can have this set to `true`."
},
"allow_connected_accounts": {
"type": "boolean",
"example": true,
"description": "Whether the user can use this OAuth provider as connected account. Multiple OAuth providers per type can have this set to `true`."
},
"account_id": {
"type": "string",
"example": "google-account-id-12345",
"description": "Account ID of the OAuth provider. This uniquely identifies the account on the provider side."
}
},
"required": [
"user_id",
"provider_config_id",
"allow_sign_in",
"allow_connected_accounts",
"account_id"
],
"example": {
"user_id": "3241a285-8329-4d69-8f3d-316e08cf140c",
"email": "test@gmail.com",
"allow_sign_in": true,
"allow_connected_accounts": true,
"account_id": "google-account-id-12345"
}
}
}
}
},
"tags": [
"Oauth"
],
"x-full-url": "https://api.stack-auth.com/api/v1/oauth-providers",
"responses": {
"201": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"account_id": {
"type": "string",
"example": "google-account-id-12345",
"description": "Account ID of the OAuth provider. This uniquely identifies the account on the provider side."
},
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"id": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The unique identifier of the OAuth provider"
},
"email": {
"type": "string",
"example": "test@gmail.com",
"description": "Email of the OAuth provider. This is used to display and identify the OAuth provider in the UI."
},
"provider_config_id": {
"type": "string",
"example": "google",
"description": "Provider config ID of the OAuth provider. This uniquely identifies the provider config on config.json file"
},
"type": {
"type": "string",
"enum": [
"google",
"github",
"microsoft",
"spotify",
"facebook",
"discord",
"gitlab",
"bitbucket",
"linkedin",
"apple",
"x",
"twitch"
],
"example": "google",
"description": "OAuth provider type, one of `google`, `github`, `microsoft`, `spotify`, `facebook`, `discord`, `gitlab`, `bitbucket`, `linkedin`, `apple`, `x`, `twitch`"
},
"allow_sign_in": {
"type": "boolean",
"example": true,
"description": "Whether the user can use this OAuth provider to sign in. Only one OAuth provider per type can have this set to `true`."
},
"allow_connected_accounts": {
"type": "boolean",
"example": true,
"description": "Whether the user can use this OAuth provider as connected account. Multiple OAuth providers per type can have this set to `true`."
}
},
"required": [
"account_id",
"user_id",
"id",
"provider_config_id",
"type",
"allow_sign_in",
"allow_connected_accounts"
]
}
}
}
}
}
}
},
"/oauth-providers/{user_id}/{provider_id}": {
"get": {
"summary": "Get an OAuth provider",
"description": "Retrieves a specific OAuth provider by the user ID and the OAuth provider ID.",
"parameters": [
{
"name": "provider_id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "user_id",
"in": "path",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": true
}
],
"tags": [
"Oauth"
],
"x-full-url": "https://api.stack-auth.com/api/v1/oauth-providers/{user_id}/{provider_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"account_id": {
"type": "string",
"example": "google-account-id-12345",
"description": "Account ID of the OAuth provider. This uniquely identifies the account on the provider side."
},
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"id": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The unique identifier of the OAuth provider"
},
"email": {
"type": "string",
"example": "test@gmail.com",
"description": "Email of the OAuth provider. This is used to display and identify the OAuth provider in the UI."
},
"provider_config_id": {
"type": "string",
"example": "google",
"description": "Provider config ID of the OAuth provider. This uniquely identifies the provider config on config.json file"
},
"type": {
"type": "string",
"enum": [
"google",
"github",
"microsoft",
"spotify",
"facebook",
"discord",
"gitlab",
"bitbucket",
"linkedin",
"apple",
"x",
"twitch"
],
"example": "google",
"description": "OAuth provider type, one of `google`, `github`, `microsoft`, `spotify`, `facebook`, `discord`, `gitlab`, `bitbucket`, `linkedin`, `apple`, `x`, `twitch`"
},
"allow_sign_in": {
"type": "boolean",
"example": true,
"description": "Whether the user can use this OAuth provider to sign in. Only one OAuth provider per type can have this set to `true`."
},
"allow_connected_accounts": {
"type": "boolean",
"example": true,
"description": "Whether the user can use this OAuth provider as connected account. Multiple OAuth providers per type can have this set to `true`."
}
},
"required": [
"account_id",
"user_id",
"id",
"provider_config_id",
"type",
"allow_sign_in",
"allow_connected_accounts"
]
}
}
}
}
}
},
"delete": {
"summary": "Delete an OAuth provider",
"description": "Removes an OAuth provider for a given user.",
"parameters": [
{
"name": "provider_id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "user_id",
"in": "path",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": true
}
],
"tags": [
"Oauth"
],
"x-full-url": "https://api.stack-auth.com/api/v1/oauth-providers/{user_id}/{provider_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "Always equal to true.",
"example": true
}
},
"required": [
"success"
]
}
}
}
}
}
},
"patch": {
"summary": "Update an OAuth provider",
"description": "Updates an existing OAuth provider. Only the values provided will be updated.",
"parameters": [
{
"name": "provider_id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "user_id",
"in": "path",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": true
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"email": {
"type": "string",
"example": "test@gmail.com",
"description": "Email of the OAuth provider. This is used to display and identify the OAuth provider in the UI."
},
"account_id": {
"type": "string",
"example": "google-account-id-12345",
"description": "Account ID of the OAuth provider. This uniquely identifies the account on the provider side."
},
"allow_sign_in": {
"type": "boolean",
"example": true,
"description": "Whether the user can use this OAuth provider to sign in. Only one OAuth provider per type can have this set to `true`."
},
"allow_connected_accounts": {
"type": "boolean",
"example": true,
"description": "Whether the user can use this OAuth provider as connected account. Multiple OAuth providers per type can have this set to `true`."
}
},
"example": {
"email": "test@gmail.com",
"account_id": "google-account-id-12345",
"allow_sign_in": true,
"allow_connected_accounts": true
}
}
}
}
},
"tags": [
"Oauth"
],
"x-full-url": "https://api.stack-auth.com/api/v1/oauth-providers/{user_id}/{provider_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"account_id": {
"type": "string",
"example": "google-account-id-12345",
"description": "Account ID of the OAuth provider. This uniquely identifies the account on the provider side."
},
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"id": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The unique identifier of the OAuth provider"
},
"email": {
"type": "string",
"example": "test@gmail.com",
"description": "Email of the OAuth provider. This is used to display and identify the OAuth provider in the UI."
},
"provider_config_id": {
"type": "string",
"example": "google",
"description": "Provider config ID of the OAuth provider. This uniquely identifies the provider config on config.json file"
},
"type": {
"type": "string",
"enum": [
"google",
"github",
"microsoft",
"spotify",
"facebook",
"discord",
"gitlab",
"bitbucket",
"linkedin",
"apple",
"x",
"twitch"
],
"example": "google",
"description": "OAuth provider type, one of `google`, `github`, `microsoft`, `spotify`, `facebook`, `discord`, `gitlab`, `bitbucket`, `linkedin`, `apple`, `x`, `twitch`"
},
"allow_sign_in": {
"type": "boolean",
"example": true,
"description": "Whether the user can use this OAuth provider to sign in. Only one OAuth provider per type can have this set to `true`."
},
"allow_connected_accounts": {
"type": "boolean",
"example": true,
"description": "Whether the user can use this OAuth provider as connected account. Multiple OAuth providers per type can have this set to `true`."
}
},
"required": [
"account_id",
"user_id",
"id",
"provider_config_id",
"type",
"allow_sign_in",
"allow_connected_accounts"
]
}
}
}
}
}
}
},
"/internal/ai-conversations": {
"get": {
"summary": "List AI conversations",
"description": "List AI conversations for the current user filtered by project",
"parameters": [
{
"name": "projectId",
"in": "query",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"Others"
],
"x-full-url": "https://api.stack-auth.com/api/v1/internal/ai-conversations",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"conversations": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"projectId": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
},
"required": [
"id",
"title",
"projectId",
"updatedAt"
]
}
}
},
"required": [
"conversations"
]
}
}
}
}
}
},
"post": {
"summary": "Create AI conversation",
"description": "Create a new AI conversation with optional initial messages",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"projectId": {
"type": "string"
},
"messages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"role": {
"type": "string",
"enum": [
"user",
"assistant"
]
},
"content": {
"type": "object"
}
},
"required": [
"role",
"content"
]
}
}
},
"required": [
"title",
"projectId",
"messages"
],
"example": {}
}
}
}
},
"tags": [
"Others"
],
"x-full-url": "https://api.stack-auth.com/api/v1/internal/ai-conversations",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
}
},
"required": [
"id",
"title"
]
}
}
}
}
}
}
},
"/internal/ai-conversations/{conversationId}": {
"get": {
"summary": "Get AI conversation",
"description": "Fetch a single AI conversation with all its messages",
"parameters": [
{
"name": "conversationId",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"Others"
],
"x-full-url": "https://api.stack-auth.com/api/v1/internal/ai-conversations/{conversationId}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"projectId": {
"type": "string"
},
"messages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"role": {
"type": "string"
},
"content": {
"type": "object"
}
},
"required": [
"id",
"role",
"content"
]
}
}
},
"required": [
"id",
"title",
"projectId",
"messages"
]
}
}
}
}
}
},
"delete": {
"summary": "Delete AI conversation",
"description": "Delete an AI conversation and all its messages",
"parameters": [
{
"name": "conversationId",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"Others"
],
"x-full-url": "https://api.stack-auth.com/api/v1/internal/ai-conversations/{conversationId}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
}
}
},
"patch": {
"summary": "Update AI conversation",
"description": "Update the title of an AI conversation",
"parameters": [
{
"name": "conversationId",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"title": {
"type": "string"
}
},
"required": [
"title"
],
"example": {}
}
}
}
},
"tags": [
"Others"
],
"x-full-url": "https://api.stack-auth.com/api/v1/internal/ai-conversations/{conversationId}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
}
}
}
},
"/internal/ai-conversations/{conversationId}/messages": {
"put": {
"summary": "Replace conversation messages",
"description": "Replace all messages in a conversation",
"parameters": [
{
"name": "conversationId",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"messages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"role": {
"type": "string",
"enum": [
"user",
"assistant"
]
},
"content": {
"type": "object"
}
},
"required": [
"role",
"content"
]
}
}
},
"required": [
"messages"
],
"example": {}
}
}
}
},
"tags": [
"Others"
],
"x-full-url": "https://api.stack-auth.com/api/v1/internal/ai-conversations/{conversationId}/messages",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
}
}
}
},
"/internal/conversations": {
"get": {
"summary": "List conversations",
"description": "List conversations for a managed project",
"parameters": [
{
"name": "projectId",
"in": "query",
"schema": {
"type": "string",
"example": "e0b52f4d-dece-408c-af49-d23061bb0f8d",
"description": "The unique identifier of the project"
},
"description": "The unique identifier of the project",
"required": true
},
{
"name": "query",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "status",
"in": "query",
"schema": {
"type": "string",
"enum": [
"open",
"pending",
"closed"
]
},
"required": false
},
{
"name": "userId",
"in": "query",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
},
"description": "The unique identifier of the user",
"required": false
},
{
"name": "limit",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "offset",
"in": "query",
"schema": {
"type": "string"
},
"required": false
}
],
"tags": [
"Others"
],
"x-full-url": "https://api.stack-auth.com/api/v1/internal/conversations",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"conversations": {
"type": "array",
"items": {
"type": "object",
"properties": {
"conversationId": {
"type": "string"
},
"userId": {
"type": "string"
},
"teamId": {
"type": "string"
},
"userDisplayName": {
"type": "string"
},
"userPrimaryEmail": {
"type": "string"
},
"userProfileImageUrl": {
"type": "string"
},
"subject": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"open",
"pending",
"closed"
]
},
"priority": {
"type": "string",
"enum": [
"low",
"normal",
"high",
"urgent"
]
},
"source": {
"type": "string",
"enum": [
"manual",
"chat",
"email",
"api"
]
},
"lastMessageType": {
"type": "string",
"enum": [
"message",
"internal-note",
"status-change"
]
},
"preview": {
"type": "string"
},
"lastActivityAt": {
"type": "string"
},
"metadata": {
"type": "object",
"properties": {
"assignedToUserId": {
"type": "string"
},
"assignedToDisplayName": {
"type": "string"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"firstResponseDueAt": {
"type": "string"
},
"firstResponseAt": {
"type": "string"
},
"nextResponseDueAt": {
"type": "string"
},
"lastCustomerReplyAt": {
"type": "string"
},
"lastAgentReplyAt": {
"type": "string"
}
},
"required": [
"tags"
]
},
"createdAt": {
"type": "string"
},
"updatedAt": {
"type": "string"
},
"lastMessageAt": {
"type": "string"
},
"lastInboundAt": {
"type": "string"
},
"lastOutboundAt": {
"type": "string"
},
"closedAt": {
"type": "string"
},
"recordMetadata": {
"type": "object"
}
},
"required": [
"conversationId",
"subject",
"status",
"priority",
"source",
"lastMessageType",
"lastActivityAt",
"metadata"
]
}
},
"hasMore": {
"type": "boolean"
}
},
"required": [
"conversations",
"hasMore"
]
}
}
}
}
}
},
"post": {
"summary": "Create conversation",
"description": "Create a managed project conversation for a user",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"projectId": {
"type": "string",
"example": "e0b52f4d-dece-408c-af49-d23061bb0f8d",
"description": "The unique identifier of the project"
},
"userId": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
},
"subject": {
"type": "string"
},
"initialMessage": {
"type": "string"
},
"priority": {
"type": "string",
"enum": [
"low",
"normal",
"high",
"urgent"
]
},
"source": {
"type": "string",
"enum": [
"manual",
"chat",
"email",
"api"
]
}
},
"required": [
"projectId",
"userId",
"subject",
"initialMessage",
"priority"
],
"example": {
"projectId": "e0b52f4d-dece-408c-af49-d23061bb0f8d",
"userId": "3241a285-8329-4d69-8f3d-316e08cf140c"
}
}
}
}
},
"tags": [
"Others"
],
"x-full-url": "https://api.stack-auth.com/api/v1/internal/conversations",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"conversationId": {
"type": "string"
}
},
"required": [
"conversationId"
]
}
}
}
}
}
}
},
"/internal/conversations/{conversationId}": {
"get": {
"summary": "Get conversation detail",
"description": "Get conversation detail for a managed project",
"parameters": [
{
"name": "projectId",
"in": "query",
"schema": {
"type": "string",
"example": "e0b52f4d-dece-408c-af49-d23061bb0f8d",
"description": "The unique identifier of the project"
},
"description": "The unique identifier of the project",
"required": true
},
{
"name": "conversationId",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"Others"
],
"x-full-url": "https://api.stack-auth.com/api/v1/internal/conversations/{conversationId}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"conversation": {
"type": "object",
"properties": {
"conversationId": {
"type": "string"
},
"userId": {
"type": "string"
},
"teamId": {
"type": "string"
},
"userDisplayName": {
"type": "string"
},
"userPrimaryEmail": {
"type": "string"
},
"userProfileImageUrl": {
"type": "string"
},
"subject": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"open",
"pending",
"closed"
]
},
"priority": {
"type": "string",
"enum": [
"low",
"normal",
"high",
"urgent"
]
},
"source": {
"type": "string",
"enum": [
"manual",
"chat",
"email",
"api"
]
},
"lastMessageType": {
"type": "string",
"enum": [
"message",
"internal-note",
"status-change"
]
},
"preview": {
"type": "string"
},
"lastActivityAt": {
"type": "string"
},
"metadata": {
"type": "object",
"properties": {
"assignedToUserId": {
"type": "string"
},
"assignedToDisplayName": {
"type": "string"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"firstResponseDueAt": {
"type": "string"
},
"firstResponseAt": {
"type": "string"
},
"nextResponseDueAt": {
"type": "string"
},
"lastCustomerReplyAt": {
"type": "string"
},
"lastAgentReplyAt": {
"type": "string"
}
},
"required": [
"tags"
]
},
"createdAt": {
"type": "string"
},
"updatedAt": {
"type": "string"
},
"lastMessageAt": {
"type": "string"
},
"lastInboundAt": {
"type": "string"
},
"lastOutboundAt": {
"type": "string"
},
"closedAt": {
"type": "string"
},
"recordMetadata": {
"type": "object"
}
},
"required": [
"conversationId",
"subject",
"status",
"priority",
"source",
"lastMessageType",
"lastActivityAt",
"metadata"
]
},
"messages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"conversationId": {
"type": "string"
},
"userId": {
"type": "string"
},
"teamId": {
"type": "string"
},
"subject": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"open",
"pending",
"closed"
]
},
"priority": {
"type": "string",
"enum": [
"low",
"normal",
"high",
"urgent"
]
},
"source": {
"type": "string",
"enum": [
"manual",
"chat",
"email",
"api"
]
},
"messageType": {
"type": "string",
"enum": [
"message",
"internal-note",
"status-change"
]
},
"body": {
"type": "string"
},
"attachments": {
"type": "array",
"items": {
"type": "object"
}
},
"metadata": {
"type": "object"
},
"createdAt": {
"type": "string"
},
"sender": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"user",
"agent",
"system"
]
},
"id": {
"type": "string"
},
"displayName": {
"type": "string"
},
"primaryEmail": {
"type": "string"
}
},
"required": [
"type"
]
}
},
"required": [
"id",
"conversationId",
"subject",
"status",
"priority",
"source",
"messageType",
"attachments",
"createdAt",
"sender"
]
}
},
"entryPoints": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"channelType": {
"type": "string"
},
"adapterKey": {
"type": "string"
},
"externalChannelId": {
"type": "string"
},
"isEntryPoint": {
"type": "boolean"
},
"metadata": {
"type": "object"
},
"createdAt": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
},
"required": [
"id",
"channelType",
"adapterKey",
"isEntryPoint",
"createdAt",
"updatedAt"
]
}
}
},
"required": [
"conversation",
"messages",
"entryPoints"
]
}
}
}
}
}
},
"patch": {
"summary": "Update conversation",
"description": "Append a message or update conversation attributes on a managed project conversation",
"parameters": [
{
"name": "conversationId",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"Others"
],
"x-full-url": "https://api.stack-auth.com/api/v1/internal/conversations/{conversationId}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"conversation": {
"type": "object",
"properties": {
"conversationId": {
"type": "string"
},
"userId": {
"type": "string"
},
"teamId": {
"type": "string"
},
"userDisplayName": {
"type": "string"
},
"userPrimaryEmail": {
"type": "string"
},
"userProfileImageUrl": {
"type": "string"
},
"subject": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"open",
"pending",
"closed"
]
},
"priority": {
"type": "string",
"enum": [
"low",
"normal",
"high",
"urgent"
]
},
"source": {
"type": "string",
"enum": [
"manual",
"chat",
"email",
"api"
]
},
"lastMessageType": {
"type": "string",
"enum": [
"message",
"internal-note",
"status-change"
]
},
"preview": {
"type": "string"
},
"lastActivityAt": {
"type": "string"
},
"metadata": {
"type": "object",
"properties": {
"assignedToUserId": {
"type": "string"
},
"assignedToDisplayName": {
"type": "string"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"firstResponseDueAt": {
"type": "string"
},
"firstResponseAt": {
"type": "string"
},
"nextResponseDueAt": {
"type": "string"
},
"lastCustomerReplyAt": {
"type": "string"
},
"lastAgentReplyAt": {
"type": "string"
}
},
"required": [
"tags"
]
},
"createdAt": {
"type": "string"
},
"updatedAt": {
"type": "string"
},
"lastMessageAt": {
"type": "string"
},
"lastInboundAt": {
"type": "string"
},
"lastOutboundAt": {
"type": "string"
},
"closedAt": {
"type": "string"
},
"recordMetadata": {
"type": "object"
}
},
"required": [
"conversationId",
"subject",
"status",
"priority",
"source",
"lastMessageType",
"lastActivityAt",
"metadata"
]
},
"messages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"conversationId": {
"type": "string"
},
"userId": {
"type": "string"
},
"teamId": {
"type": "string"
},
"subject": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"open",
"pending",
"closed"
]
},
"priority": {
"type": "string",
"enum": [
"low",
"normal",
"high",
"urgent"
]
},
"source": {
"type": "string",
"enum": [
"manual",
"chat",
"email",
"api"
]
},
"messageType": {
"type": "string",
"enum": [
"message",
"internal-note",
"status-change"
]
},
"body": {
"type": "string"
},
"attachments": {
"type": "array",
"items": {
"type": "object"
}
},
"metadata": {
"type": "object"
},
"createdAt": {
"type": "string"
},
"sender": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"user",
"agent",
"system"
]
},
"id": {
"type": "string"
},
"displayName": {
"type": "string"
},
"primaryEmail": {
"type": "string"
}
},
"required": [
"type"
]
}
},
"required": [
"id",
"conversationId",
"subject",
"status",
"priority",
"source",
"messageType",
"attachments",
"createdAt",
"sender"
]
}
},
"entryPoints": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"channelType": {
"type": "string"
},
"adapterKey": {
"type": "string"
},
"externalChannelId": {
"type": "string"
},
"isEntryPoint": {
"type": "boolean"
},
"metadata": {
"type": "object"
},
"createdAt": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
},
"required": [
"id",
"channelType",
"adapterKey",
"isEntryPoint",
"createdAt",
"updatedAt"
]
}
}
},
"required": [
"conversation",
"messages",
"entryPoints"
]
}
}
}
}
}
}
},
"/auth/mfa/sign-in": {
"post": {
"summary": "MFA sign in",
"description": "Complete multi-factor authorization to sign in, with a TOTP and an MFA attempt code",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"totp"
]
},
"totp": {
"type": "string"
},
"code": {
"type": "string",
"example": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2",
"description": "A 45 character code"
}
},
"required": [
"type",
"totp",
"code"
],
"example": {
"code": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2"
}
}
}
}
},
"tags": [
"OTP"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/mfa/sign-in",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"refresh_token": {
"type": "string",
"example": "i8ns3aq2...14y",
"description": "Long-lived refresh token that can be used to obtain a new access token"
},
"access_token": {
"type": "string",
"example": "eyJhmMiJB2TO...diI4QT",
"description": "Short-lived access token that can be used to authenticate the user"
},
"is_new_user": {
"type": "boolean",
"example": true,
"description": "Whether the user is a new user"
},
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
}
},
"required": [
"refresh_token",
"access_token",
"is_new_user",
"user_id"
]
}
}
}
}
}
}
},
"/auth/otp/send-sign-in-code": {
"post": {
"summary": "Send sign-in code",
"description": "Send a code to the user's email address for sign-in.",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"email": {
"type": "string",
"example": "johndoe@example.com",
"description": "The email to sign in with."
},
"callback_url": {
"type": "string",
"example": "https://example.com/handler/magic-link-callback",
"description": "The base callback URL to construct the magic link from. A query parameter `code` with the verification code will be appended to it. The page should then make a request to the `/auth/otp/sign-in` endpoint."
},
"bot_challenge_token": {
"type": "string"
},
"bot_challenge_phase": {
"type": "string",
"enum": [
"invisible",
"visible"
]
},
"bot_challenge_unavailable": {
"type": "string",
"enum": [
"true"
]
}
},
"required": [
"email",
"callback_url"
],
"example": {
"email": "johndoe@example.com",
"callback_url": "https://example.com/handler/magic-link-callback"
}
}
}
}
},
"tags": [
"OTP"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/otp/send-sign-in-code",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"nonce": {
"type": "string",
"example": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2",
"description": "A token that must be stored temporarily and provided when verifying the 6-digit code"
}
},
"required": [
"nonce"
]
}
}
}
}
}
}
},
"/auth/otp/sign-in": {
"post": {
"summary": "Sign in with a code",
"description": "",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2",
"description": "A 45-character verification code. For magic links, this is the code found in the \"code\" URL query parameter. For OTP, this is formed by concatenating the 6-digit code entered by the user with the nonce (received during code creation)"
}
},
"required": [
"code"
],
"example": {
"code": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2"
}
}
}
}
},
"tags": [
"OTP"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/otp/sign-in",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"refresh_token": {
"type": "string",
"example": "i8ns3aq2...14y",
"description": "Long-lived refresh token that can be used to obtain a new access token"
},
"access_token": {
"type": "string",
"example": "eyJhmMiJB2TO...diI4QT",
"description": "Short-lived access token that can be used to authenticate the user"
},
"is_new_user": {
"type": "boolean",
"example": true,
"description": "Whether the user is a new user"
},
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
}
},
"required": [
"refresh_token",
"access_token",
"is_new_user",
"user_id"
]
}
}
}
}
}
}
},
"/auth/otp/sign-in/check-code": {
"post": {
"summary": "Check sign in code",
"description": "Check if a sign in code is valid without using it",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2",
"description": "A 45-character verification code. For magic links, this is the code found in the \"code\" URL query parameter. For OTP, this is formed by concatenating the 6-digit code entered by the user with the nonce (received during code creation)"
}
},
"required": [
"code"
],
"example": {
"code": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2"
}
}
}
}
},
"tags": [
"OTP"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/otp/sign-in/check-code",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"is_code_valid": {
"type": "boolean"
}
},
"required": [
"is_code_valid"
]
}
}
}
}
}
}
},
"/auth/password/reset": {
"post": {
"summary": "Reset password with a code",
"description": "Reset password with a code",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"code": {
"type": "string",
"example": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2",
"description": "A 45 character code"
}
},
"required": [
"password",
"code"
],
"example": {
"code": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2"
}
}
}
}
},
"tags": [
"Password"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/password/reset",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "Always equal to true.",
"example": true
}
},
"required": [
"success"
]
}
}
}
}
}
}
},
"/auth/password/reset/check-code": {
"post": {
"summary": "Check reset password code",
"description": "Check if a reset password code is valid without using it",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2",
"description": "A 45 character code"
}
},
"required": [
"code"
],
"example": {
"code": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2"
}
}
}
}
},
"tags": [
"Password"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/password/reset/check-code",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"is_code_valid": {
"type": "boolean"
}
},
"required": [
"is_code_valid"
]
}
}
}
}
}
}
},
"/auth/password/send-reset-code": {
"post": {
"summary": "Send reset password code",
"description": "Send a code to the user's email address for resetting the password.",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"callback_url": {
"type": "string"
}
},
"required": [
"email",
"callback_url"
],
"example": {}
}
}
}
},
"tags": [
"Password"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/password/send-reset-code",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "string",
"enum": [
"maybe, only if user with e-mail exists"
]
}
},
"required": [
"success"
]
}
}
}
}
}
}
},
"/auth/password/set": {
"post": {
"summary": "Set password",
"description": "Set a new password for the current user",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"password": {
"type": "string"
}
},
"required": [
"password"
],
"example": {}
}
}
}
},
"tags": [
"Password"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/password/set",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "Always equal to true.",
"example": true
}
},
"required": [
"success"
]
}
}
}
}
}
}
},
"/auth/password/sign-in": {
"post": {
"summary": "Sign in with email and password",
"description": "Sign in to an account with email and password",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"password": {
"type": "string"
}
},
"required": [
"email",
"password"
],
"example": {}
}
}
}
},
"tags": [
"Password"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/password/sign-in",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
},
"refresh_token": {
"type": "string"
},
"user_id": {
"type": "string"
}
},
"required": [
"access_token",
"refresh_token",
"user_id"
]
}
}
}
}
}
}
},
"/auth/password/sign-up": {
"post": {
"summary": "Sign up with email and password",
"description": "Create a new account with email and password",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"email": {
"type": "string",
"example": "johndoe@example.com",
"description": "The email to sign in with."
},
"password": {
"type": "string"
},
"verification_callback_url": {
"type": "string",
"example": "https://example.com/handler/email-verification",
"description": "The base callback URL to construct a verification link for the verification e-mail. A query parameter `code` with the verification code will be appended to it. The page should then make a request to the `/contact-channels/verify` endpoint."
},
"bot_challenge_token": {
"type": "string"
},
"bot_challenge_phase": {
"type": "string",
"enum": [
"invisible",
"visible"
]
},
"bot_challenge_unavailable": {
"type": "string",
"enum": [
"true"
]
}
},
"required": [
"email",
"password"
],
"example": {
"email": "johndoe@example.com",
"verification_callback_url": "https://example.com/handler/email-verification"
}
}
}
}
},
"tags": [
"Password"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/password/sign-up",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
},
"refresh_token": {
"type": "string"
},
"user_id": {
"type": "string"
}
},
"required": [
"access_token",
"refresh_token",
"user_id"
]
}
}
}
}
}
}
},
"/auth/password/update": {
"post": {
"summary": "Update password",
"description": "Update the password of the current user, requires the old password",
"parameters": [
{
"name": "x-stack-refresh-token",
"in": "header",
"schema": {
"type": "string"
},
"required": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"old_password": {
"type": "string"
},
"new_password": {
"type": "string"
}
},
"required": [
"old_password",
"new_password"
],
"example": {}
}
}
}
},
"tags": [
"Password"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/password/update",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "Always equal to true.",
"example": true
}
},
"required": [
"success"
]
}
}
}
}
}
}
},
"/payments/items/{customer_type}/{customer_id}/{item_id}": {
"get": {
"summary": "Get Item",
"description": "Retrieves information about a specific item (credits, quotas, etc.) for a customer.",
"parameters": [
{
"name": "customer_type",
"in": "path",
"schema": {
"type": "string",
"enum": [
"user",
"team",
"custom"
],
"example": "user",
"description": "The type of customer"
},
"description": "The type of customer",
"required": true
},
{
"name": "customer_id",
"in": "path",
"schema": {
"type": "string",
"example": "user_1234567890abcdef",
"description": "The ID of the customer"
},
"description": "The ID of the customer",
"required": true
},
{
"name": "item_id",
"in": "path",
"schema": {
"type": "string",
"example": "credits",
"description": "The ID of the item to retrieve"
},
"description": "The ID of the item to retrieve",
"required": true
}
],
"tags": [
"Payments"
],
"x-full-url": "https://api.stack-auth.com/api/v1/payments/items/{customer_type}/{customer_id}/{item_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "credits",
"description": "The ID of the item"
},
"display_name": {
"type": "string",
"example": "API Credits",
"description": "The human-readable name of the item"
},
"quantity": {
"type": "number",
"example": 1000,
"description": "The current quantity of the item (can be negative)"
}
},
"required": [
"id",
"display_name",
"quantity"
]
}
}
}
}
}
}
},
"/payments/items/{customer_type}/{customer_id}/{item_id}/update-quantity": {
"post": {
"summary": "Update Item Quantity",
"description": "Updates the quantity of an item for a customer. Can increase or decrease quantities, with optional expiration and negative balance control.",
"parameters": [
{
"name": "allow_negative",
"in": "query",
"schema": {
"type": "string",
"enum": [
"true",
"false"
],
"example": "false",
"description": "Whether to allow the quantity to go negative"
},
"description": "Whether to allow the quantity to go negative",
"required": true
},
{
"name": "customer_type",
"in": "path",
"schema": {
"type": "string",
"enum": [
"user",
"team",
"custom"
],
"example": "user",
"description": "The type of customer"
},
"description": "The type of customer",
"required": true
},
{
"name": "customer_id",
"in": "path",
"schema": {
"type": "string",
"example": "user_1234567890abcdef",
"description": "The ID of the customer"
},
"description": "The ID of the customer",
"required": true
},
{
"name": "item_id",
"in": "path",
"schema": {
"type": "string",
"example": "credits",
"description": "The ID of the item to update"
},
"description": "The ID of the item to update",
"required": true
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"delta": {
"type": "integer",
"example": 100,
"description": "The amount to change the quantity by (positive to increase, negative to decrease)"
},
"expires_at": {
"type": "string",
"example": "2024-12-31T23:59:59Z",
"description": "Optional expiration date for this quantity change (ISO 8601 format)"
},
"description": {
"type": "string",
"example": "Monthly subscription renewal",
"description": "Optional description for this quantity change"
}
},
"required": [
"delta"
],
"example": {
"delta": 100,
"expires_at": "2024-12-31T23:59:59Z",
"description": "Monthly subscription renewal"
}
}
}
}
},
"tags": [
"Payments"
],
"x-full-url": "https://api.stack-auth.com/api/v1/payments/items/{customer_type}/{customer_id}/{item_id}/update-quantity",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
}
}
}
},
"/payments/purchases/create-purchase-url": {
"post": {
"summary": "Create Purchase URL",
"description": "Creates a secure checkout URL for purchasing a product.",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"customer_type": {
"type": "string",
"enum": [
"user",
"team",
"custom"
],
"example": "user",
"description": "The type of customer making the purchase"
},
"customer_id": {
"type": "string",
"example": "user_1234567890abcdef",
"description": "The ID of the customer (user ID, team ID, or custom customer ID)"
},
"product_id": {
"type": "string",
"example": "prod_premium_monthly",
"description": "The ID of the product to purchase. Either this or product_inline should be given."
},
"product_inline": {
"type": "object",
"properties": {
"display_name": {
"type": "string"
},
"customer_type": {
"type": "string",
"enum": [
"user",
"team",
"custom"
]
},
"free_trial": {
"type": "array",
"items": {
"type": "integer"
}
},
"server_only": {
"type": "boolean",
"default": true
},
"stackable": {
"type": "boolean",
"default": false
},
"prices": {
"type": "object",
"properties": {},
"required": []
},
"included_items": {
"type": "object",
"properties": {},
"required": []
},
"client_metadata": {
"type": "object",
"example": {
"featureFlag": true,
"source": "marketing-campaign"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"featureFlag": true,
"source": "marketing-campaign"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
},
"server_metadata": {
"type": "object",
"example": {
"featureFlag": true,
"source": "marketing-campaign"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the product here."
}
},
"required": [
"display_name",
"customer_type"
],
"description": "Inline product definition. Either this or product_id should be given."
},
"return_url": {
"type": "string",
"example": "https://myapp.com/purchase-success",
"description": "URL to redirect to after purchase completion. Must be configured as a trusted domain in the project configuration."
}
},
"required": [
"customer_type",
"customer_id"
],
"example": {
"customer_type": "user",
"customer_id": "user_1234567890abcdef",
"product_id": "prod_premium_monthly",
"return_url": "https://myapp.com/purchase-success"
}
}
}
}
},
"tags": [
"Payments"
],
"x-full-url": "https://api.stack-auth.com/api/v1/payments/purchases/create-purchase-url",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "The secure checkout URL for completing the purchase"
}
},
"required": [
"url"
]
}
}
}
}
}
}
},
"/payments/purchases/purchase-session": {
"post": {
"summary": "Create Purchase Session",
"description": "Creates a purchase session for completing a purchase.",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"full_code": {
"type": "string",
"example": "proj_abc123_def456ghi789",
"description": "The verification code, given as a query parameter in the purchase URL"
},
"price_id": {
"type": "string",
"example": "price_1234567890abcdef",
"description": "The Stack auth price ID to purchase"
},
"quantity": {
"type": "integer",
"example": 1,
"description": "The quantity to purchase",
"default": 1
}
},
"required": [
"full_code",
"price_id"
],
"example": {
"full_code": "proj_abc123_def456ghi789",
"price_id": "price_1234567890abcdef",
"quantity": 1
}
}
}
}
},
"tags": [
"Payments"
],
"x-full-url": "https://api.stack-auth.com/api/v1/payments/purchases/purchase-session",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"client_secret": {
"type": "string",
"example": "1234567890abcdef_secret_xyz123",
"description": "Stripe client secret used by the browser to confirm payment via Stripe Elements. Omitted when no payment step is required from the customer; in that case the purchase is being settled without a confirmation step and the caller should skip mounting Stripe Elements."
}
}
}
}
}
}
}
}
},
"/payments/purchases/validate-code": {
"post": {
"summary": "Validate Purchase Code",
"description": "Validates a purchase verification code and returns purchase details including available prices.",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"full_code": {
"type": "string",
"example": "proj_abc123_def456ghi789",
"description": "The verification code, given as a query parameter in the purchase URL"
},
"return_url": {
"type": "string",
"example": "https://myapp.com/purchase-success",
"description": "URL to redirect to after purchase completion"
}
},
"required": [
"full_code"
],
"example": {
"full_code": "proj_abc123_def456ghi789",
"return_url": "https://myapp.com/purchase-success"
}
}
}
}
},
"tags": [
"Payments"
],
"x-full-url": "https://api.stack-auth.com/api/v1/payments/purchases/validate-code",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"product": {
"type": "object",
"properties": {
"display_name": {
"type": "string"
},
"customer_type": {
"type": "string",
"enum": [
"user",
"team",
"custom"
]
},
"free_trial": {
"type": "array",
"items": {
"type": "integer"
}
},
"server_only": {
"type": "boolean",
"default": true
},
"stackable": {
"type": "boolean",
"default": false
},
"prices": {
"type": "object",
"properties": {},
"required": []
},
"included_items": {
"type": "object",
"properties": {},
"required": []
},
"client_metadata": {
"type": "object",
"example": {
"featureFlag": true,
"source": "marketing-campaign"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"featureFlag": true,
"source": "marketing-campaign"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
},
"server_metadata": {
"type": "object",
"example": {
"featureFlag": true,
"source": "marketing-campaign"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the product here."
}
},
"required": [
"display_name",
"customer_type"
]
},
"stripe_account_id": {
"type": "string"
},
"project_id": {
"type": "string"
},
"project_logo_url": {
"type": "string"
},
"already_bought_non_stackable": {
"type": "boolean"
},
"conflicting_products": {
"type": "array",
"items": {
"type": "object",
"properties": {
"product_id": {
"type": "string"
},
"display_name": {
"type": "string"
}
},
"required": [
"product_id",
"display_name"
]
}
},
"test_mode": {
"type": "boolean"
},
"charges_enabled": {
"type": "boolean"
}
},
"required": [
"stripe_account_id",
"project_id",
"already_bought_non_stackable",
"conflicting_products",
"test_mode",
"charges_enabled"
]
}
}
}
}
}
}
},
"/project-permissions": {
"get": {
"summary": "List project permissions",
"description": "Query and filter the permission with `user_id` and `permission_id`. `(user_id, permission_id)` together uniquely identify a permission.",
"parameters": [
{
"name": "user_id",
"in": "query",
"schema": {
"type": "string",
"example": "me",
"description": "Filter with the user ID. If set, only the permissions this user has will be returned. Client request must set `user_id=me`"
},
"description": "Filter with the user ID. If set, only the permissions this user has will be returned. Client request must set `user_id=me`",
"required": false
},
{
"name": "permission_id",
"in": "query",
"schema": {
"type": "string",
"example": "16399452-c4f3-4554-8e44-c2d67bb60360",
"description": "Filter with the permission ID. If set, only the permissions with this specific ID will be returned"
},
"description": "Filter with the permission ID. If set, only the permissions with this specific ID will be returned",
"required": false
},
{
"name": "recursive",
"in": "query",
"schema": {
"type": "string",
"enum": [
"true",
"false"
],
"example": "true",
"description": "Whether to list permissions recursively. If set to `false`, only the permission the users directly have will be listed. If set to `true` all the direct and indirect permissions will be listed."
},
"description": "Whether to list permissions recursively. If set to `false`, only the permission the users directly have will be listed. If set to `true` all the direct and indirect permissions will be listed.",
"required": false
}
],
"tags": [
"Permissions"
],
"x-full-url": "https://api.stack-auth.com/api/v1/project-permissions",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "read_secret_info",
"description": "The permission ID used to uniquely identify a permission. Can either be a custom permission with lowercase letters, numbers, `:`, and `_` characters, or one of the system permissions: `$update_team`, `$delete_team`, `$read_members`, `$remove_members`, `$invite_members`, `$manage_api_keys`"
},
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
}
},
"required": [
"id",
"user_id"
]
}
},
"pagination": {
"type": "object",
"properties": {
"next_cursor": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The cursor to fetch the next page of results. null if there is no next page."
}
},
"required": []
}
},
"required": [
"items"
]
}
}
}
}
}
}
},
"/project-permissions/{user_id}/{permission_id}": {
"post": {
"summary": "Grant a global permission to a user",
"description": "Grant a global permission to a user (the permission must be created first on the Stack dashboard)",
"parameters": [
{
"name": "user_id",
"in": "path",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": false
},
{
"name": "permission_id",
"in": "path",
"schema": {
"type": "string",
"example": "read_secret_info",
"description": "The permission ID used to uniquely identify a permission. Can either be a custom permission with lowercase letters, numbers, `:`, and `_` characters, or one of the system permissions: `$update_team`, `$delete_team`, `$read_members`, `$remove_members`, `$invite_members`, `$manage_api_keys`"
},
"description": "The permission ID used to uniquely identify a permission. Can either be a custom permission with lowercase letters, numbers, `:`, and `_` characters, or one of the system permissions: `$update_team`, `$delete_team`, `$read_members`, `$remove_members`, `$invite_members`, `$manage_api_keys`",
"required": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {},
"example": {}
}
}
}
},
"tags": [
"Permissions"
],
"x-full-url": "https://api.stack-auth.com/api/v1/project-permissions/{user_id}/{permission_id}",
"responses": {
"201": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "read_secret_info",
"description": "The permission ID used to uniquely identify a permission. Can either be a custom permission with lowercase letters, numbers, `:`, and `_` characters, or one of the system permissions: `$update_team`, `$delete_team`, `$read_members`, `$remove_members`, `$invite_members`, `$manage_api_keys`"
},
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
}
},
"required": [
"id",
"user_id"
]
}
}
}
}
}
},
"delete": {
"summary": "Revoke a global permission from a user",
"description": "Revoke a global permission from a user",
"parameters": [
{
"name": "user_id",
"in": "path",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": true
},
{
"name": "permission_id",
"in": "path",
"schema": {
"type": "string",
"example": "read_secret_info",
"description": "The permission ID used to uniquely identify a permission. Can either be a custom permission with lowercase letters, numbers, `:`, and `_` characters, or one of the system permissions: `$update_team`, `$delete_team`, `$read_members`, `$remove_members`, `$invite_members`, `$manage_api_keys`"
},
"description": "The permission ID used to uniquely identify a permission. Can either be a custom permission with lowercase letters, numbers, `:`, and `_` characters, or one of the system permissions: `$update_team`, `$delete_team`, `$read_members`, `$remove_members`, `$invite_members`, `$manage_api_keys`",
"required": true
}
],
"tags": [
"Permissions"
],
"x-full-url": "https://api.stack-auth.com/api/v1/project-permissions/{user_id}/{permission_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "Always equal to true.",
"example": true
}
},
"required": [
"success"
]
}
}
}
}
}
}
},
"/team-permissions": {
"get": {
"summary": "List team permissions of a user",
"description": "Query and filter the permission with `team_id`, `user_id`, and `permission_id`. Note that this might contain the permissions with the same permission ID across different teams and users. `(team_id, user_id, permission_id)` together uniquely identify a permission.",
"parameters": [
{
"name": "team_id",
"in": "query",
"schema": {
"type": "string",
"example": "cce084a3-28b7-418e-913e-c8ee6d802ea4",
"description": "Filter with the team ID. If set, only the permissions of the members in a specific team will be returned."
},
"description": "Filter with the team ID. If set, only the permissions of the members in a specific team will be returned.",
"required": false
},
{
"name": "user_id",
"in": "query",
"schema": {
"type": "string",
"example": "me",
"description": "Filter with the user ID. If set, only the permissions this user has will be returned. Client request must set `user_id=me`"
},
"description": "Filter with the user ID. If set, only the permissions this user has will be returned. Client request must set `user_id=me`",
"required": false
},
{
"name": "permission_id",
"in": "query",
"schema": {
"type": "string",
"example": "16399452-c4f3-4554-8e44-c2d67bb60360",
"description": "Filter with the permission ID. If set, only the permissions with this specific ID will be returned"
},
"description": "Filter with the permission ID. If set, only the permissions with this specific ID will be returned",
"required": false
},
{
"name": "recursive",
"in": "query",
"schema": {
"type": "string",
"enum": [
"true",
"false"
],
"example": "true",
"description": "Whether to list permissions recursively. If set to `false`, only the permission the users directly have will be listed. If set to `true` all the direct and indirect permissions will be listed."
},
"description": "Whether to list permissions recursively. If set to `false`, only the permission the users directly have will be listed. If set to `true` all the direct and indirect permissions will be listed.",
"required": false
}
],
"tags": [
"Permissions"
],
"x-full-url": "https://api.stack-auth.com/api/v1/team-permissions",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "read_secret_info",
"description": "The permission ID used to uniquely identify a permission. Can either be a custom permission with lowercase letters, numbers, `:`, and `_` characters, or one of the system permissions: `$update_team`, `$delete_team`, `$read_members`, `$remove_members`, `$invite_members`, `$manage_api_keys`"
},
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
},
"team_id": {
"type": "string",
"example": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"description": "The unique identifier of the team"
}
},
"required": [
"id",
"user_id",
"team_id"
]
}
},
"pagination": {
"type": "object",
"properties": {
"next_cursor": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The cursor to fetch the next page of results. null if there is no next page."
}
},
"required": []
}
},
"required": [
"items"
]
}
}
}
}
}
}
},
"/team-permissions/{team_id}/{user_id}/{permission_id}": {
"post": {
"summary": "Grant a team permission to a user",
"description": "Grant a team permission to a user (the team permission must be created first on the Stack dashboard)",
"parameters": [
{
"name": "team_id",
"in": "path",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "user_id",
"in": "path",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": false
},
{
"name": "permission_id",
"in": "path",
"schema": {
"type": "string",
"example": "read_secret_info",
"description": "The permission ID used to uniquely identify a permission. Can either be a custom permission with lowercase letters, numbers, `:`, and `_` characters, or one of the system permissions: `$update_team`, `$delete_team`, `$read_members`, `$remove_members`, `$invite_members`, `$manage_api_keys`"
},
"description": "The permission ID used to uniquely identify a permission. Can either be a custom permission with lowercase letters, numbers, `:`, and `_` characters, or one of the system permissions: `$update_team`, `$delete_team`, `$read_members`, `$remove_members`, `$invite_members`, `$manage_api_keys`",
"required": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {},
"example": {}
}
}
}
},
"tags": [
"Permissions"
],
"x-full-url": "https://api.stack-auth.com/api/v1/team-permissions/{team_id}/{user_id}/{permission_id}",
"responses": {
"201": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "read_secret_info",
"description": "The permission ID used to uniquely identify a permission. Can either be a custom permission with lowercase letters, numbers, `:`, and `_` characters, or one of the system permissions: `$update_team`, `$delete_team`, `$read_members`, `$remove_members`, `$invite_members`, `$manage_api_keys`"
},
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
},
"team_id": {
"type": "string",
"example": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"description": "The unique identifier of the team"
}
},
"required": [
"id",
"user_id",
"team_id"
]
}
}
}
}
}
},
"delete": {
"summary": "Revoke a team permission from a user",
"description": "Revoke a team permission from a user",
"parameters": [
{
"name": "team_id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "user_id",
"in": "path",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": true
},
{
"name": "permission_id",
"in": "path",
"schema": {
"type": "string",
"example": "read_secret_info",
"description": "The permission ID used to uniquely identify a permission. Can either be a custom permission with lowercase letters, numbers, `:`, and `_` characters, or one of the system permissions: `$update_team`, `$delete_team`, `$read_members`, `$remove_members`, `$invite_members`, `$manage_api_keys`"
},
"description": "The permission ID used to uniquely identify a permission. Can either be a custom permission with lowercase letters, numbers, `:`, and `_` characters, or one of the system permissions: `$update_team`, `$delete_team`, `$read_members`, `$remove_members`, `$invite_members`, `$manage_api_keys`",
"required": true
}
],
"tags": [
"Permissions"
],
"x-full-url": "https://api.stack-auth.com/api/v1/team-permissions/{team_id}/{user_id}/{permission_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "Always equal to true.",
"example": true
}
},
"required": [
"success"
]
}
}
}
}
}
}
},
"/projects/current": {
"get": {
"summary": "Get the current project",
"description": "Get the current project information including display name, OAuth providers and authentication methods. Useful for displaying the available login options to the user.",
"parameters": [],
"tags": [
"Projects"
],
"x-full-url": "https://api.stack-auth.com/api/v1/projects/current",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "e0b52f4d-dece-408c-af49-d23061bb0f8d",
"description": "The unique identifier of the project"
},
"display_name": {
"type": "string",
"example": "MyMusic",
"description": "Human-readable project display name. This is not a unique identifier."
}
},
"required": [
"id",
"display_name"
]
}
}
}
}
}
}
},
"/auth/sessions": {
"get": {
"summary": "List sessions",
"description": "List all sessions for the current user.",
"parameters": [
{
"name": "user_id",
"in": "query",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": true
}
],
"tags": [
"Sessions"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/sessions",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"user_id": {
"type": "string"
},
"created_at": {
"type": "number"
},
"is_impersonation": {
"type": "boolean"
},
"last_used_at": {
"type": "number"
},
"is_current_session": {
"type": "boolean"
},
"last_used_at_end_user_ip_info": {
"type": "object",
"properties": {
"ip": {
"type": "string"
},
"countryCode": {
"type": "string"
},
"regionCode": {
"type": "string"
},
"cityName": {
"type": "string"
},
"latitude": {
"type": "number"
},
"longitude": {
"type": "number"
},
"tzIdentifier": {
"type": "string"
}
},
"required": [
"ip"
]
}
},
"required": [
"id",
"user_id",
"created_at",
"is_impersonation"
]
}
},
"pagination": {
"type": "object",
"properties": {
"next_cursor": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The cursor to fetch the next page of results. null if there is no next page."
}
},
"required": []
}
},
"required": [
"items"
]
}
}
}
}
}
},
"post": {
"summary": "Create session",
"description": "Create a new session for a given user. This will return a refresh token that can be used to impersonate the user.",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"expires_in_millis": {
"type": "number",
"default": 31536000000
},
"is_impersonation": {
"type": "boolean"
}
},
"required": [
"user_id"
],
"example": {
"user_id": "3241a285-8329-4d69-8f3d-316e08cf140c"
}
}
}
}
},
"tags": [
"Sessions"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/sessions",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"refresh_token": {
"type": "string"
},
"access_token": {
"type": "string"
}
},
"required": [
"refresh_token",
"access_token"
]
}
}
}
}
}
}
},
"/auth/sessions/current": {
"delete": {
"summary": "Sign out of the current session",
"description": "Sign out of the current session and invalidate the refresh token",
"parameters": [],
"tags": [
"Sessions"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/sessions/current",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "Always equal to true.",
"example": true
}
},
"required": [
"success"
]
}
}
}
}
}
}
},
"/auth/sessions/current/refresh": {
"post": {
"summary": "Refresh access token",
"description": "Get a new access token using a refresh token",
"parameters": [
{
"name": "x-stack-refresh-token",
"in": "header",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"Sessions"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/sessions/current/refresh",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
}
},
"required": [
"access_token"
]
}
}
}
}
}
}
},
"/auth/sessions/{id}": {
"delete": {
"summary": "Delete session",
"description": "Delete a session by ID.",
"parameters": [
{
"name": "user_id",
"in": "query",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": true
},
{
"name": "id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"Sessions"
],
"x-full-url": "https://api.stack-auth.com/api/v1/auth/sessions/{id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "Always equal to true.",
"example": true
}
},
"required": [
"success"
]
}
}
}
}
}
}
},
"/team-invitations": {
"get": {
"summary": "List team invitations",
"description": "",
"parameters": [
{
"name": "team_id",
"in": "query",
"schema": {
"type": "string",
"description": "The team ID to list invitations for. Required unless user_id is provided."
},
"description": "The team ID to list invitations for. Required unless user_id is provided.",
"required": false
},
{
"name": "user_id",
"in": "query",
"schema": {
"type": "string",
"description": "List invitations sent to this user's verified emails. Must be \"me\" for client access. Cannot be combined with team_id."
},
"description": "List invitations sent to this user's verified emails. Must be \"me\" for client access. Cannot be combined with team_id.",
"required": false
}
],
"tags": [
"Teams"
],
"x-full-url": "https://api.stack-auth.com/api/v1/team-invitations",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"team_id": {
"type": "string",
"example": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"description": "The unique identifier of the team"
},
"team_display_name": {
"type": "string"
},
"expires_at_millis": {
"type": "number"
},
"recipient_email": {
"type": "string"
}
},
"required": [
"id",
"team_id",
"team_display_name",
"expires_at_millis",
"recipient_email"
]
}
},
"pagination": {
"type": "object",
"properties": {
"next_cursor": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The cursor to fetch the next page of results. null if there is no next page."
}
},
"required": []
}
},
"required": [
"items"
]
}
}
}
}
}
}
},
"/team-invitations/accept": {
"post": {
"summary": "Accept the team invitation",
"description": "Accept invitation and add user to the team",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2",
"description": "A 45 character code"
}
},
"required": [
"code"
],
"example": {
"code": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2"
}
}
}
}
},
"tags": [
"Teams"
],
"x-full-url": "https://api.stack-auth.com/api/v1/team-invitations/accept",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
}
}
}
},
"/team-invitations/accept/check-code": {
"post": {
"summary": "Check if a team invitation code is valid",
"description": "Check if a team invitation code is valid without using it",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2",
"description": "A 45 character code"
}
},
"required": [
"code"
],
"example": {
"code": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2"
}
}
}
}
},
"tags": [
"Teams"
],
"x-full-url": "https://api.stack-auth.com/api/v1/team-invitations/accept/check-code",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"is_code_valid": {
"type": "boolean"
}
},
"required": [
"is_code_valid"
]
}
}
}
}
}
}
},
"/team-invitations/accept/details": {
"post": {
"summary": "Get team invitation details",
"description": "Get additional information about a team invitation code",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2",
"description": "A 45 character code"
}
},
"required": [
"code"
],
"example": {
"code": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2"
}
}
}
}
},
"tags": [
"Teams"
],
"x-full-url": "https://api.stack-auth.com/api/v1/team-invitations/accept/details",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"team_id": {
"type": "string"
},
"team_display_name": {
"type": "string"
}
},
"required": [
"team_id",
"team_display_name"
]
}
}
}
}
}
}
},
"/team-invitations/send-code": {
"post": {
"summary": "Send an email to invite a user to a team",
"description": "The user receiving this email can join the team by clicking on the link in the email. If the user does not have an account yet, they will be prompted to create one.",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"team_id": {
"type": "string",
"example": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"description": "The unique identifier of the team"
},
"email": {
"type": "string",
"example": "johndoe@example.com",
"description": "The email of the user to invite."
},
"callback_url": {
"type": "string",
"example": "https://example.com/handler/team-invitation",
"description": "The base callback URL to construct an invite link with. A query parameter `code` with the verification code will be appended to it. The page should then make a request to the `/team-invitations/accept` endpoint."
}
},
"required": [
"team_id",
"email",
"callback_url"
],
"example": {
"team_id": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"email": "johndoe@example.com",
"callback_url": "https://example.com/handler/team-invitation"
}
}
}
}
},
"tags": [
"Teams"
],
"x-full-url": "https://api.stack-auth.com/api/v1/team-invitations/send-code",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"id": {
"type": "string"
}
},
"required": [
"success",
"id"
]
}
}
}
}
}
}
},
"/team-invitations/{id}": {
"delete": {
"summary": "Delete a team invitation",
"description": "",
"parameters": [
{
"name": "team_id",
"in": "query",
"schema": {
"type": "string",
"description": "The team ID to list invitations for. Required unless user_id is provided."
},
"description": "The team ID to list invitations for. Required unless user_id is provided.",
"required": false
},
{
"name": "id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"Teams"
],
"x-full-url": "https://api.stack-auth.com/api/v1/team-invitations/{id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "Always equal to true.",
"example": true
}
},
"required": [
"success"
]
}
}
}
}
}
}
},
"/team-invitations/{id}/accept": {
"post": {
"summary": "Accept a team invitation by ID",
"description": "Accepts a team invitation for the specified user. The user must have a verified email matching the invitation's recipient email. This marks the invitation as used and adds the user to the team.",
"parameters": [
{
"name": "user_id",
"in": "query",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": true
},
{
"name": "id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"Teams"
],
"x-full-url": "https://api.stack-auth.com/api/v1/team-invitations/{id}/accept",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
}
}
}
},
"/team-member-profiles": {
"get": {
"summary": "List team members profiles",
"description": "List team members profiles and filter by team ID and user ID",
"parameters": [
{
"name": "user_id",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "team_id",
"in": "query",
"schema": {
"type": "string"
},
"required": false
}
],
"tags": [
"Teams"
],
"x-full-url": "https://api.stack-auth.com/api/v1/team-member-profiles",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"user": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
},
"primary_email": {
"type": "string",
"example": "johndoe@example.com",
"description": "Primary email"
},
"primary_email_verified": {
"type": "boolean",
"example": true,
"description": "Whether the primary email has been verified to belong to this user"
},
"primary_email_auth_enabled": {
"type": "boolean",
"example": true,
"description": "Whether the primary email is used for authentication. If this is set to `false`, the user will not be able to sign in with the primary email with password or OTP"
},
"display_name": {
"type": "string",
"example": "John Doe",
"description": "Human-readable user display name. This is not a unique identifier."
},
"selected_team": {
"type": "object",
"properties": {
"created_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the team was created (the number of milliseconds since epoch, January 1, 1970, UTC)"
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the team here."
},
"id": {
"type": "string",
"example": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"description": "The unique identifier of the team"
},
"display_name": {
"type": "string",
"example": "My Team",
"description": "Human-readable team display name. This is not a unique identifier."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for team. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
}
},
"required": [
"created_at_millis",
"id",
"display_name"
]
},
"selected_team_id": {
"type": "string",
"example": "team-id",
"description": "ID of the team currently selected by the user"
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for user. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"signed_up_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the user signed up (identify) => `(the number of milliseconds since epoch, January 1, 1970, UTC)`"
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the user here."
},
"last_active_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the user was last active (identify) => `(the number of milliseconds since epoch, January 1, 1970, UTC)`"
},
"is_anonymous": {
"type": "boolean"
},
"is_restricted": {
"type": "boolean",
"example": false,
"description": "Whether the user is in restricted state (has signed up but not completed onboarding requirements)"
},
"restricted_reason": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"anonymous",
"email_not_verified",
"restricted_by_administrator"
]
}
},
"required": [
"type"
],
"example": null,
"description": "The reason why the user is restricted (e.g., type: \"email_not_verified\", \"anonymous\", or \"restricted_by_administrator\"), null if not restricted"
},
"restricted_by_admin": {
"type": "boolean",
"example": false,
"description": "Whether the user is restricted by an administrator. Can be set manually or by sign-up rules."
},
"restricted_by_admin_reason": {
"type": "string",
"example": null,
"description": "Public reason shown to the user explaining why they are restricted. Optional."
},
"restricted_by_admin_private_details": {
"type": "string",
"example": null,
"description": "Private details about the restriction (e.g., which sign-up rule triggered). Only visible to server access and above."
},
"country_code": {
"type": "string",
"example": "US",
"description": "Best-effort ISO country code captured at sign-up time from request geo headers."
},
"risk_scores": {
"type": "object",
"properties": {
"sign_up": {
"type": "object",
"properties": {
"bot": {
"type": "integer"
},
"free_trial_abuse": {
"type": "integer"
}
},
"required": [
"bot",
"free_trial_abuse"
]
}
},
"required": [
"sign_up"
],
"example": {
"sign_up": {
"bot": 0,
"free_trial_abuse": 0
}
},
"description": "User risk scores used for sign-up risk evaluation."
}
},
"required": [
"id",
"primary_email_verified",
"primary_email_auth_enabled",
"signed_up_at_millis",
"last_active_at_millis",
"is_anonymous",
"is_restricted",
"restricted_by_admin",
"risk_scores"
]
},
"team_id": {
"type": "string",
"example": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"description": "The unique identifier of the team"
},
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
},
"display_name": {
"type": "string",
"example": "John Doe",
"description": "Human-readable team member display name. This is not a unique identifier. Note that this is separate from the display_name of the user."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for team member. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
}
},
"required": [
"user",
"team_id",
"user_id"
]
}
},
"pagination": {
"type": "object",
"properties": {
"next_cursor": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The cursor to fetch the next page of results. null if there is no next page."
}
},
"required": []
}
},
"required": [
"items"
]
}
}
}
}
}
}
},
"/team-member-profiles/{team_id}/{user_id}": {
"get": {
"summary": "Get a team member profile",
"description": "Get a team member profile by user ID",
"parameters": [
{
"name": "team_id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "user_id",
"in": "path",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": true
}
],
"tags": [
"Teams"
],
"x-full-url": "https://api.stack-auth.com/api/v1/team-member-profiles/{team_id}/{user_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"user": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
},
"primary_email": {
"type": "string",
"example": "johndoe@example.com",
"description": "Primary email"
},
"primary_email_verified": {
"type": "boolean",
"example": true,
"description": "Whether the primary email has been verified to belong to this user"
},
"primary_email_auth_enabled": {
"type": "boolean",
"example": true,
"description": "Whether the primary email is used for authentication. If this is set to `false`, the user will not be able to sign in with the primary email with password or OTP"
},
"display_name": {
"type": "string",
"example": "John Doe",
"description": "Human-readable user display name. This is not a unique identifier."
},
"selected_team": {
"type": "object",
"properties": {
"created_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the team was created (the number of milliseconds since epoch, January 1, 1970, UTC)"
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the team here."
},
"id": {
"type": "string",
"example": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"description": "The unique identifier of the team"
},
"display_name": {
"type": "string",
"example": "My Team",
"description": "Human-readable team display name. This is not a unique identifier."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for team. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
}
},
"required": [
"created_at_millis",
"id",
"display_name"
]
},
"selected_team_id": {
"type": "string",
"example": "team-id",
"description": "ID of the team currently selected by the user"
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for user. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"signed_up_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the user signed up (identify) => `(the number of milliseconds since epoch, January 1, 1970, UTC)`"
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the user here."
},
"last_active_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the user was last active (identify) => `(the number of milliseconds since epoch, January 1, 1970, UTC)`"
},
"is_anonymous": {
"type": "boolean"
},
"is_restricted": {
"type": "boolean",
"example": false,
"description": "Whether the user is in restricted state (has signed up but not completed onboarding requirements)"
},
"restricted_reason": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"anonymous",
"email_not_verified",
"restricted_by_administrator"
]
}
},
"required": [
"type"
],
"example": null,
"description": "The reason why the user is restricted (e.g., type: \"email_not_verified\", \"anonymous\", or \"restricted_by_administrator\"), null if not restricted"
},
"restricted_by_admin": {
"type": "boolean",
"example": false,
"description": "Whether the user is restricted by an administrator. Can be set manually or by sign-up rules."
},
"restricted_by_admin_reason": {
"type": "string",
"example": null,
"description": "Public reason shown to the user explaining why they are restricted. Optional."
},
"restricted_by_admin_private_details": {
"type": "string",
"example": null,
"description": "Private details about the restriction (e.g., which sign-up rule triggered). Only visible to server access and above."
},
"country_code": {
"type": "string",
"example": "US",
"description": "Best-effort ISO country code captured at sign-up time from request geo headers."
},
"risk_scores": {
"type": "object",
"properties": {
"sign_up": {
"type": "object",
"properties": {
"bot": {
"type": "integer"
},
"free_trial_abuse": {
"type": "integer"
}
},
"required": [
"bot",
"free_trial_abuse"
]
}
},
"required": [
"sign_up"
],
"example": {
"sign_up": {
"bot": 0,
"free_trial_abuse": 0
}
},
"description": "User risk scores used for sign-up risk evaluation."
}
},
"required": [
"id",
"primary_email_verified",
"primary_email_auth_enabled",
"signed_up_at_millis",
"last_active_at_millis",
"is_anonymous",
"is_restricted",
"restricted_by_admin",
"risk_scores"
]
},
"team_id": {
"type": "string",
"example": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"description": "The unique identifier of the team"
},
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
},
"display_name": {
"type": "string",
"example": "John Doe",
"description": "Human-readable team member display name. This is not a unique identifier. Note that this is separate from the display_name of the user."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for team member. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
}
},
"required": [
"user",
"team_id",
"user_id"
]
}
}
}
}
}
},
"patch": {
"summary": "Update a team member profile",
"description": "Update a team member profile by user ID",
"parameters": [
{
"name": "team_id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "user_id",
"in": "path",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": true
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"display_name": {
"type": "string",
"example": "John Doe",
"description": "Human-readable team member display name. This is not a unique identifier. Note that this is separate from the display_name of the user."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for team member. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
}
},
"example": {
"display_name": "John Doe",
"profile_image_url": "https://example.com/image.jpg"
}
}
}
}
},
"tags": [
"Teams"
],
"x-full-url": "https://api.stack-auth.com/api/v1/team-member-profiles/{team_id}/{user_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"user": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
},
"primary_email": {
"type": "string",
"example": "johndoe@example.com",
"description": "Primary email"
},
"primary_email_verified": {
"type": "boolean",
"example": true,
"description": "Whether the primary email has been verified to belong to this user"
},
"primary_email_auth_enabled": {
"type": "boolean",
"example": true,
"description": "Whether the primary email is used for authentication. If this is set to `false`, the user will not be able to sign in with the primary email with password or OTP"
},
"display_name": {
"type": "string",
"example": "John Doe",
"description": "Human-readable user display name. This is not a unique identifier."
},
"selected_team": {
"type": "object",
"properties": {
"created_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the team was created (the number of milliseconds since epoch, January 1, 1970, UTC)"
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the team here."
},
"id": {
"type": "string",
"example": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"description": "The unique identifier of the team"
},
"display_name": {
"type": "string",
"example": "My Team",
"description": "Human-readable team display name. This is not a unique identifier."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for team. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
}
},
"required": [
"created_at_millis",
"id",
"display_name"
]
},
"selected_team_id": {
"type": "string",
"example": "team-id",
"description": "ID of the team currently selected by the user"
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for user. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"signed_up_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the user signed up (identify) => `(the number of milliseconds since epoch, January 1, 1970, UTC)`"
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the user here."
},
"last_active_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the user was last active (identify) => `(the number of milliseconds since epoch, January 1, 1970, UTC)`"
},
"is_anonymous": {
"type": "boolean"
},
"is_restricted": {
"type": "boolean",
"example": false,
"description": "Whether the user is in restricted state (has signed up but not completed onboarding requirements)"
},
"restricted_reason": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"anonymous",
"email_not_verified",
"restricted_by_administrator"
]
}
},
"required": [
"type"
],
"example": null,
"description": "The reason why the user is restricted (e.g., type: \"email_not_verified\", \"anonymous\", or \"restricted_by_administrator\"), null if not restricted"
},
"restricted_by_admin": {
"type": "boolean",
"example": false,
"description": "Whether the user is restricted by an administrator. Can be set manually or by sign-up rules."
},
"restricted_by_admin_reason": {
"type": "string",
"example": null,
"description": "Public reason shown to the user explaining why they are restricted. Optional."
},
"restricted_by_admin_private_details": {
"type": "string",
"example": null,
"description": "Private details about the restriction (e.g., which sign-up rule triggered). Only visible to server access and above."
},
"country_code": {
"type": "string",
"example": "US",
"description": "Best-effort ISO country code captured at sign-up time from request geo headers."
},
"risk_scores": {
"type": "object",
"properties": {
"sign_up": {
"type": "object",
"properties": {
"bot": {
"type": "integer"
},
"free_trial_abuse": {
"type": "integer"
}
},
"required": [
"bot",
"free_trial_abuse"
]
}
},
"required": [
"sign_up"
],
"example": {
"sign_up": {
"bot": 0,
"free_trial_abuse": 0
}
},
"description": "User risk scores used for sign-up risk evaluation."
}
},
"required": [
"id",
"primary_email_verified",
"primary_email_auth_enabled",
"signed_up_at_millis",
"last_active_at_millis",
"is_anonymous",
"is_restricted",
"restricted_by_admin",
"risk_scores"
]
},
"team_id": {
"type": "string",
"example": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"description": "The unique identifier of the team"
},
"user_id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
},
"display_name": {
"type": "string",
"example": "John Doe",
"description": "Human-readable team member display name. This is not a unique identifier. Note that this is separate from the display_name of the user."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for team member. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
}
},
"required": [
"user",
"team_id",
"user_id"
]
}
}
}
}
}
}
},
"/team-memberships/{team_id}/{user_id}": {
"post": {
"summary": "Add a user to a team",
"description": "",
"parameters": [
{
"name": "team_id",
"in": "path",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "user_id",
"in": "path",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {},
"example": {}
}
}
}
},
"tags": [
"Teams"
],
"x-full-url": "https://api.stack-auth.com/api/v1/team-memberships/{team_id}/{user_id}",
"responses": {
"201": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"team_id": {
"type": "string"
},
"user_id": {
"type": "string"
}
},
"required": [
"team_id",
"user_id"
]
}
}
}
}
}
},
"delete": {
"summary": "Remove a user from a team",
"description": "",
"parameters": [
{
"name": "team_id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "user_id",
"in": "path",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": true
}
],
"tags": [
"Teams"
],
"x-full-url": "https://api.stack-auth.com/api/v1/team-memberships/{team_id}/{user_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "Always equal to true.",
"example": true
}
},
"required": [
"success"
]
}
}
}
}
}
}
},
"/teams": {
"get": {
"summary": "List teams",
"description": "List all the teams in the project.",
"parameters": [
{
"name": "user_id",
"in": "query",
"schema": {
"type": "string",
"example": "me",
"description": "Filter for the teams that the user is a member of. Can be either `me` or an ID. Must be `me` in the client API"
},
"description": "Filter for the teams that the user is a member of. Can be either `me` or an ID. Must be `me` in the client API",
"required": false
},
{
"name": "order_by",
"in": "query",
"schema": {
"type": "string",
"enum": [
"created_at"
],
"example": "created_at",
"description": "Field to order results by. Currently only `created_at` is supported."
},
"description": "Field to order results by. Currently only `created_at` is supported.",
"required": false
},
{
"name": "desc",
"in": "query",
"schema": {
"type": "string",
"enum": [
"true",
"false"
],
"example": "false",
"description": "Whether to order results in descending order. Defaults to false (ascending)."
},
"description": "Whether to order results in descending order. Defaults to false (ascending).",
"required": false
},
{
"name": "limit",
"in": "query",
"schema": {
"type": "integer",
"description": "The maximum number of items to return (capped at 200)."
},
"description": "The maximum number of items to return (capped at 200).",
"required": false
},
{
"name": "cursor",
"in": "query",
"schema": {
"type": "string",
"description": "The cursor to start the result set from. Requires `limit` to also be set."
},
"description": "The cursor to start the result set from. Requires `limit` to also be set.",
"required": false
},
{
"name": "query",
"in": "query",
"schema": {
"type": "string",
"description": "A search query to filter the results by. Free-text search applied to the team's id (exact-match) and display name."
},
"description": "A search query to filter the results by. Free-text search applied to the team's id (exact-match) and display name.",
"required": false
}
],
"tags": [
"Teams"
],
"x-full-url": "https://api.stack-auth.com/api/v1/teams",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"created_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the team was created (the number of milliseconds since epoch, January 1, 1970, UTC)"
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the team here."
},
"id": {
"type": "string",
"example": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"description": "The unique identifier of the team"
},
"display_name": {
"type": "string",
"example": "My Team",
"description": "Human-readable team display name. This is not a unique identifier."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for team. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
}
},
"required": [
"created_at_millis",
"id",
"display_name"
]
}
},
"pagination": {
"type": "object",
"properties": {
"next_cursor": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The cursor to fetch the next page of results. null if there is no next page."
}
},
"required": []
}
},
"required": [
"items"
]
}
}
}
}
}
},
"post": {
"summary": "Create a team",
"description": "Create a new team and optionally add the current user as a member.",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"display_name": {
"type": "string",
"example": "My Team",
"description": "Human-readable team display name. This is not a unique identifier."
},
"creator_user_id": {
"type": "string",
"example": "me",
"description": "The ID of the creator of the team. If not specified, the user will not be added to the team. Can be either \"me\" or the ID of the user. Only used on the client side."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the team here."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for team. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
}
},
"required": [
"display_name"
],
"example": {
"display_name": "My Team",
"creator_user_id": "me",
"client_read_only_metadata": {
"key": "value"
},
"server_metadata": {
"key": "value"
},
"profile_image_url": "https://example.com/image.jpg",
"client_metadata": {
"key": "value"
}
}
}
}
}
},
"tags": [
"Teams"
],
"x-full-url": "https://api.stack-auth.com/api/v1/teams",
"responses": {
"201": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"created_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the team was created (the number of milliseconds since epoch, January 1, 1970, UTC)"
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the team here."
},
"id": {
"type": "string",
"example": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"description": "The unique identifier of the team"
},
"display_name": {
"type": "string",
"example": "My Team",
"description": "Human-readable team display name. This is not a unique identifier."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for team. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
}
},
"required": [
"created_at_millis",
"id",
"display_name"
]
}
}
}
}
}
}
},
"/teams/{team_id}": {
"get": {
"summary": "Get a team",
"description": "Get a team by ID.",
"parameters": [
{
"name": "team_id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"Teams"
],
"x-full-url": "https://api.stack-auth.com/api/v1/teams/{team_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"created_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the team was created (the number of milliseconds since epoch, January 1, 1970, UTC)"
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the team here."
},
"id": {
"type": "string",
"example": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"description": "The unique identifier of the team"
},
"display_name": {
"type": "string",
"example": "My Team",
"description": "Human-readable team display name. This is not a unique identifier."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for team. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
}
},
"required": [
"created_at_millis",
"id",
"display_name"
]
}
}
}
}
}
},
"delete": {
"summary": "Delete a team",
"description": "Delete a team by ID.",
"parameters": [
{
"name": "team_id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"Teams"
],
"x-full-url": "https://api.stack-auth.com/api/v1/teams/{team_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "Always equal to true.",
"example": true
}
},
"required": [
"success"
]
}
}
}
}
}
},
"patch": {
"summary": "Update a team",
"description": "Update the team information by ID.",
"parameters": [
{
"name": "team_id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the team here."
},
"display_name": {
"type": "string",
"example": "My Team",
"description": "Human-readable team display name. This is not a unique identifier."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for team. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
}
},
"example": {
"client_read_only_metadata": {
"key": "value"
},
"server_metadata": {
"key": "value"
},
"display_name": "My Team",
"profile_image_url": "https://example.com/image.jpg",
"client_metadata": {
"key": "value"
}
}
}
}
}
},
"tags": [
"Teams"
],
"x-full-url": "https://api.stack-auth.com/api/v1/teams/{team_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"created_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the team was created (the number of milliseconds since epoch, January 1, 1970, UTC)"
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the team here."
},
"id": {
"type": "string",
"example": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"description": "The unique identifier of the team"
},
"display_name": {
"type": "string",
"example": "My Team",
"description": "Human-readable team display name. This is not a unique identifier."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for team. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
}
},
"required": [
"created_at_millis",
"id",
"display_name"
]
}
}
}
}
}
}
},
"/users": {
"get": {
"summary": "List users",
"description": "Lists all the users in the project. By default, only fully onboarded users are returned. Restricted users (those who haven't completed onboarding requirements like email verification) are included if `include_restricted` is set to `true`. Anonymous users are included if `include_anonymous` is set to `true` (which also includes restricted users).",
"parameters": [
{
"name": "team_id",
"in": "query",
"schema": {
"type": "string",
"description": "Only return users who are members of the given team"
},
"description": "Only return users who are members of the given team",
"required": false
},
{
"name": "limit",
"in": "query",
"schema": {
"type": "integer",
"description": "The maximum number of items to return"
},
"description": "The maximum number of items to return",
"required": false
},
{
"name": "cursor",
"in": "query",
"schema": {
"type": "string",
"description": "The cursor to start the result set from."
},
"description": "The cursor to start the result set from.",
"required": false
},
{
"name": "order_by",
"in": "query",
"schema": {
"type": "string",
"enum": [
"signed_up_at",
"last_active_at"
],
"description": "The field to sort the results by. Defaults to signed_up_at"
},
"description": "The field to sort the results by. Defaults to signed_up_at",
"required": false
},
{
"name": "desc",
"in": "query",
"schema": {
"type": "string",
"enum": [
"true",
"false"
],
"description": "Whether to sort the results in descending order. Defaults to false"
},
"description": "Whether to sort the results in descending order. Defaults to false",
"required": false
},
{
"name": "query",
"in": "query",
"schema": {
"type": "string",
"description": "A search query to filter the results by. This is a free-text search that is applied to the user's id (exact-match only), display name and primary email."
},
"description": "A search query to filter the results by. This is a free-text search that is applied to the user's id (exact-match only), display name and primary email.",
"required": false
},
{
"name": "include_anonymous",
"in": "query",
"schema": {
"type": "string",
"enum": [
"true",
"false"
],
"description": "Whether to include anonymous users in the results. When true, also includes restricted users. Defaults to false"
},
"description": "Whether to include anonymous users in the results. When true, also includes restricted users. Defaults to false",
"required": false
},
{
"name": "only_anonymous",
"in": "query",
"schema": {
"type": "string",
"enum": [
"true",
"false"
],
"description": "Whether to return only anonymous users. When true, implies include_anonymous=true. Defaults to false"
},
"description": "Whether to return only anonymous users. When true, implies include_anonymous=true. Defaults to false",
"required": false
},
{
"name": "include_restricted",
"in": "query",
"schema": {
"type": "string",
"enum": [
"true",
"false"
],
"description": "Whether to include restricted users in the results. Defaults to false"
},
"description": "Whether to include restricted users in the results. Defaults to false",
"required": false
}
],
"tags": [
"Users"
],
"x-full-url": "https://api.stack-auth.com/api/v1/users",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
},
"primary_email": {
"type": "string",
"example": "johndoe@example.com",
"description": "Primary email"
},
"primary_email_verified": {
"type": "boolean",
"example": true,
"description": "Whether the primary email has been verified to belong to this user"
},
"primary_email_auth_enabled": {
"type": "boolean",
"example": true,
"description": "Whether the primary email is used for authentication. If this is set to `false`, the user will not be able to sign in with the primary email with password or OTP"
},
"display_name": {
"type": "string",
"example": "John Doe",
"description": "Human-readable user display name. This is not a unique identifier."
},
"selected_team": {
"type": "object",
"properties": {
"created_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the team was created (the number of milliseconds since epoch, January 1, 1970, UTC)"
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the team here."
},
"id": {
"type": "string",
"example": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"description": "The unique identifier of the team"
},
"display_name": {
"type": "string",
"example": "My Team",
"description": "Human-readable team display name. This is not a unique identifier."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for team. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
}
},
"required": [
"created_at_millis",
"id",
"display_name"
]
},
"selected_team_id": {
"type": "string",
"example": "team-id",
"description": "ID of the team currently selected by the user"
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for user. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"signed_up_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the user signed up (identify) => `(the number of milliseconds since epoch, January 1, 1970, UTC)`"
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the user here."
},
"last_active_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the user was last active (identify) => `(the number of milliseconds since epoch, January 1, 1970, UTC)`"
},
"is_anonymous": {
"type": "boolean"
},
"is_restricted": {
"type": "boolean",
"example": false,
"description": "Whether the user is in restricted state (has signed up but not completed onboarding requirements)"
},
"restricted_reason": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"anonymous",
"email_not_verified",
"restricted_by_administrator"
]
}
},
"required": [
"type"
],
"example": null,
"description": "The reason why the user is restricted (e.g., type: \"email_not_verified\", \"anonymous\", or \"restricted_by_administrator\"), null if not restricted"
},
"restricted_by_admin": {
"type": "boolean",
"example": false,
"description": "Whether the user is restricted by an administrator. Can be set manually or by sign-up rules."
},
"restricted_by_admin_reason": {
"type": "string",
"example": null,
"description": "Public reason shown to the user explaining why they are restricted. Optional."
},
"restricted_by_admin_private_details": {
"type": "string",
"example": null,
"description": "Private details about the restriction (e.g., which sign-up rule triggered). Only visible to server access and above."
},
"country_code": {
"type": "string",
"example": "US",
"description": "Best-effort ISO country code captured at sign-up time from request geo headers."
},
"risk_scores": {
"type": "object",
"properties": {
"sign_up": {
"type": "object",
"properties": {
"bot": {
"type": "integer"
},
"free_trial_abuse": {
"type": "integer"
}
},
"required": [
"bot",
"free_trial_abuse"
]
}
},
"required": [
"sign_up"
],
"example": {
"sign_up": {
"bot": 0,
"free_trial_abuse": 0
}
},
"description": "User risk scores used for sign-up risk evaluation."
}
},
"required": [
"id",
"primary_email_verified",
"primary_email_auth_enabled",
"signed_up_at_millis",
"last_active_at_millis",
"is_anonymous",
"is_restricted",
"restricted_by_admin",
"risk_scores"
]
}
},
"pagination": {
"type": "object",
"properties": {
"next_cursor": {
"type": "string",
"example": "b3d396b8-c574-4c80-97b3-50031675ceb2",
"description": "The cursor to fetch the next page of results. null if there is no next page."
}
},
"required": []
}
},
"required": [
"items"
]
}
}
}
}
}
},
"post": {
"summary": "Create user",
"description": "Creates a new user. E-mail authentication is always enabled, and no password is set, meaning the only way to authenticate the newly created user is through magic link.",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"is_anonymous": {
"type": "boolean"
},
"display_name": {
"type": "string",
"example": "John Doe",
"description": "Human-readable user display name. This is not a unique identifier."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for user. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the user here."
},
"primary_email": {
"type": "string",
"example": "johndoe@example.com",
"description": "Primary email"
},
"primary_email_verified": {
"type": "boolean",
"example": true,
"description": "Whether the primary email has been verified to belong to this user"
},
"primary_email_auth_enabled": {
"type": "boolean",
"example": true,
"description": "Whether the primary email is used for authentication. If this is set to `false`, the user will not be able to sign in with the primary email with password or OTP"
},
"password": {
"type": "string",
"example": "my-new-password",
"description": "Sets the user's password. Doing so revokes all current sessions."
},
"password_hash": {
"type": "string",
"description": "If `password` is not given, sets the user's password hash to the given string in Modular Crypt Format (ex.: `$2a$10$VIhIOofSMqGdGlL4wzE//e.77dAQGqNtF/1dT7bqCrVtQuInWy2qi`). Doing so revokes all current sessions."
},
"totp_secret_base64": {
"type": "string",
"example": "dG90cC1zZWNyZXQ=",
"description": "Enables 2FA and sets a TOTP secret for the user. Set to null to disable 2FA."
},
"restricted_by_admin": {
"type": "boolean",
"example": false,
"description": "Whether the user is restricted by an administrator. Can be set manually or by sign-up rules."
},
"restricted_by_admin_reason": {
"type": "string",
"example": null,
"description": "Public reason shown to the user explaining why they are restricted. Optional."
},
"restricted_by_admin_private_details": {
"type": "string",
"example": null,
"description": "Private details about the restriction (e.g., which sign-up rule triggered). Only visible to server access and above."
},
"country_code": {
"type": "string",
"example": "US",
"description": "Best-effort ISO country code captured at sign-up time from request geo headers."
},
"risk_scores": {
"type": "object",
"properties": {
"sign_up": {
"type": "object",
"properties": {
"bot": {
"type": "integer"
},
"free_trial_abuse": {
"type": "integer"
}
},
"required": [
"bot",
"free_trial_abuse"
]
}
},
"required": [
"sign_up"
]
}
},
"example": {
"display_name": "John Doe",
"profile_image_url": "https://example.com/image.jpg",
"client_metadata": {
"key": "value"
},
"client_read_only_metadata": {
"key": "value"
},
"server_metadata": {
"key": "value"
},
"primary_email": "johndoe@example.com",
"primary_email_verified": true,
"primary_email_auth_enabled": true,
"password": "my-new-password",
"totp_secret_base64": "dG90cC1zZWNyZXQ=",
"restricted_by_admin": false,
"restricted_by_admin_reason": null,
"restricted_by_admin_private_details": null,
"country_code": "US"
}
}
}
}
},
"tags": [
"Users"
],
"x-full-url": "https://api.stack-auth.com/api/v1/users",
"responses": {
"201": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
},
"primary_email": {
"type": "string",
"example": "johndoe@example.com",
"description": "Primary email"
},
"primary_email_verified": {
"type": "boolean",
"example": true,
"description": "Whether the primary email has been verified to belong to this user"
},
"primary_email_auth_enabled": {
"type": "boolean",
"example": true,
"description": "Whether the primary email is used for authentication. If this is set to `false`, the user will not be able to sign in with the primary email with password or OTP"
},
"display_name": {
"type": "string",
"example": "John Doe",
"description": "Human-readable user display name. This is not a unique identifier."
},
"selected_team": {
"type": "object",
"properties": {
"created_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the team was created (the number of milliseconds since epoch, January 1, 1970, UTC)"
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the team here."
},
"id": {
"type": "string",
"example": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"description": "The unique identifier of the team"
},
"display_name": {
"type": "string",
"example": "My Team",
"description": "Human-readable team display name. This is not a unique identifier."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for team. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
}
},
"required": [
"created_at_millis",
"id",
"display_name"
]
},
"selected_team_id": {
"type": "string",
"example": "team-id",
"description": "ID of the team currently selected by the user"
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for user. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"signed_up_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the user signed up (identify) => `(the number of milliseconds since epoch, January 1, 1970, UTC)`"
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the user here."
},
"last_active_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the user was last active (identify) => `(the number of milliseconds since epoch, January 1, 1970, UTC)`"
},
"is_anonymous": {
"type": "boolean"
},
"is_restricted": {
"type": "boolean",
"example": false,
"description": "Whether the user is in restricted state (has signed up but not completed onboarding requirements)"
},
"restricted_reason": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"anonymous",
"email_not_verified",
"restricted_by_administrator"
]
}
},
"required": [
"type"
],
"example": null,
"description": "The reason why the user is restricted (e.g., type: \"email_not_verified\", \"anonymous\", or \"restricted_by_administrator\"), null if not restricted"
},
"restricted_by_admin": {
"type": "boolean",
"example": false,
"description": "Whether the user is restricted by an administrator. Can be set manually or by sign-up rules."
},
"restricted_by_admin_reason": {
"type": "string",
"example": null,
"description": "Public reason shown to the user explaining why they are restricted. Optional."
},
"restricted_by_admin_private_details": {
"type": "string",
"example": null,
"description": "Private details about the restriction (e.g., which sign-up rule triggered). Only visible to server access and above."
},
"country_code": {
"type": "string",
"example": "US",
"description": "Best-effort ISO country code captured at sign-up time from request geo headers."
},
"risk_scores": {
"type": "object",
"properties": {
"sign_up": {
"type": "object",
"properties": {
"bot": {
"type": "integer"
},
"free_trial_abuse": {
"type": "integer"
}
},
"required": [
"bot",
"free_trial_abuse"
]
}
},
"required": [
"sign_up"
],
"example": {
"sign_up": {
"bot": 0,
"free_trial_abuse": 0
}
},
"description": "User risk scores used for sign-up risk evaluation."
}
},
"required": [
"id",
"primary_email_verified",
"primary_email_auth_enabled",
"signed_up_at_millis",
"last_active_at_millis",
"is_anonymous",
"is_restricted",
"restricted_by_admin",
"risk_scores"
]
}
}
}
}
}
}
},
"/users/me": {
"get": {
"summary": "Get current user",
"description": "Gets the currently authenticated user.",
"parameters": [],
"tags": [
"Users"
],
"x-full-url": "https://api.stack-auth.com/api/v1/users/me",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
},
"primary_email": {
"type": "string",
"example": "johndoe@example.com",
"description": "Primary email"
},
"primary_email_verified": {
"type": "boolean",
"example": true,
"description": "Whether the primary email has been verified to belong to this user"
},
"primary_email_auth_enabled": {
"type": "boolean",
"example": true,
"description": "Whether the primary email is used for authentication. If this is set to `false`, the user will not be able to sign in with the primary email with password or OTP"
},
"display_name": {
"type": "string",
"example": "John Doe",
"description": "Human-readable user display name. This is not a unique identifier."
},
"selected_team": {
"type": "object",
"properties": {
"created_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the team was created (the number of milliseconds since epoch, January 1, 1970, UTC)"
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the team here."
},
"id": {
"type": "string",
"example": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"description": "The unique identifier of the team"
},
"display_name": {
"type": "string",
"example": "My Team",
"description": "Human-readable team display name. This is not a unique identifier."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for team. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
}
},
"required": [
"created_at_millis",
"id",
"display_name"
]
},
"selected_team_id": {
"type": "string",
"example": "team-id",
"description": "ID of the team currently selected by the user"
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for user. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"signed_up_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the user signed up (identify) => `(the number of milliseconds since epoch, January 1, 1970, UTC)`"
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the user here."
},
"last_active_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the user was last active (identify) => `(the number of milliseconds since epoch, January 1, 1970, UTC)`"
},
"is_anonymous": {
"type": "boolean"
},
"is_restricted": {
"type": "boolean",
"example": false,
"description": "Whether the user is in restricted state (has signed up but not completed onboarding requirements)"
},
"restricted_reason": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"anonymous",
"email_not_verified",
"restricted_by_administrator"
]
}
},
"required": [
"type"
],
"example": null,
"description": "The reason why the user is restricted (e.g., type: \"email_not_verified\", \"anonymous\", or \"restricted_by_administrator\"), null if not restricted"
},
"restricted_by_admin": {
"type": "boolean",
"example": false,
"description": "Whether the user is restricted by an administrator. Can be set manually or by sign-up rules."
},
"restricted_by_admin_reason": {
"type": "string",
"example": null,
"description": "Public reason shown to the user explaining why they are restricted. Optional."
},
"restricted_by_admin_private_details": {
"type": "string",
"example": null,
"description": "Private details about the restriction (e.g., which sign-up rule triggered). Only visible to server access and above."
},
"country_code": {
"type": "string",
"example": "US",
"description": "Best-effort ISO country code captured at sign-up time from request geo headers."
},
"risk_scores": {
"type": "object",
"properties": {
"sign_up": {
"type": "object",
"properties": {
"bot": {
"type": "integer"
},
"free_trial_abuse": {
"type": "integer"
}
},
"required": [
"bot",
"free_trial_abuse"
]
}
},
"required": [
"sign_up"
],
"example": {
"sign_up": {
"bot": 0,
"free_trial_abuse": 0
}
},
"description": "User risk scores used for sign-up risk evaluation."
}
},
"required": [
"id",
"primary_email_verified",
"primary_email_auth_enabled",
"signed_up_at_millis",
"last_active_at_millis",
"is_anonymous",
"is_restricted",
"restricted_by_admin",
"risk_scores"
]
}
}
}
}
}
},
"delete": {
"summary": "Delete current user",
"description": "Deletes the currently authenticated user. Use this with caution.",
"parameters": [],
"tags": [
"Users"
],
"x-full-url": "https://api.stack-auth.com/api/v1/users/me",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "Always equal to true.",
"example": true
}
},
"required": [
"success"
]
}
}
}
}
}
},
"patch": {
"summary": "Update current user",
"description": "Updates the currently authenticated user. Only the values provided will be updated.",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"display_name": {
"type": "string",
"example": "John Doe",
"description": "Human-readable user display name. This is not a unique identifier."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for user. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the user here."
},
"primary_email": {
"type": "string",
"example": "johndoe@example.com",
"description": "Primary email"
},
"primary_email_verified": {
"type": "boolean",
"example": true,
"description": "Whether the primary email has been verified to belong to this user"
},
"primary_email_auth_enabled": {
"type": "boolean",
"example": true,
"description": "Whether the primary email is used for authentication. If this is set to `false`, the user will not be able to sign in with the primary email with password or OTP"
},
"password": {
"type": "string",
"example": "my-new-password",
"description": "Sets the user's password. Doing so revokes all current sessions."
},
"password_hash": {
"type": "string",
"description": "If `password` is not given, sets the user's password hash to the given string in Modular Crypt Format (ex.: `$2a$10$VIhIOofSMqGdGlL4wzE//e.77dAQGqNtF/1dT7bqCrVtQuInWy2qi`). Doing so revokes all current sessions."
},
"totp_secret_base64": {
"type": "string",
"example": "dG90cC1zZWNyZXQ=",
"description": "Enables 2FA and sets a TOTP secret for the user. Set to null to disable 2FA."
},
"selected_team_id": {
"type": "string",
"example": "team-id",
"description": "ID of the team currently selected by the user"
},
"is_anonymous": {
"type": "boolean"
},
"restricted_by_admin": {
"type": "boolean",
"example": false,
"description": "Whether the user is restricted by an administrator. Can be set manually or by sign-up rules."
},
"restricted_by_admin_reason": {
"type": "string",
"example": null,
"description": "Public reason shown to the user explaining why they are restricted. Optional."
},
"restricted_by_admin_private_details": {
"type": "string",
"example": null,
"description": "Private details about the restriction (e.g., which sign-up rule triggered). Only visible to server access and above."
},
"country_code": {
"type": "string",
"example": "US",
"description": "Best-effort ISO country code captured at sign-up time from request geo headers."
},
"risk_scores": {
"type": "object",
"properties": {
"sign_up": {
"type": "object",
"properties": {
"bot": {
"type": "integer"
},
"free_trial_abuse": {
"type": "integer"
}
},
"required": [
"bot",
"free_trial_abuse"
]
}
},
"required": [
"sign_up"
]
}
},
"example": {
"display_name": "John Doe",
"profile_image_url": "https://example.com/image.jpg",
"client_metadata": {
"key": "value"
},
"client_read_only_metadata": {
"key": "value"
},
"server_metadata": {
"key": "value"
},
"primary_email": "johndoe@example.com",
"primary_email_verified": true,
"primary_email_auth_enabled": true,
"password": "my-new-password",
"totp_secret_base64": "dG90cC1zZWNyZXQ=",
"selected_team_id": "team-id",
"restricted_by_admin": false,
"restricted_by_admin_reason": null,
"restricted_by_admin_private_details": null,
"country_code": "US"
}
}
}
}
},
"tags": [
"Users"
],
"x-full-url": "https://api.stack-auth.com/api/v1/users/me",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
},
"primary_email": {
"type": "string",
"example": "johndoe@example.com",
"description": "Primary email"
},
"primary_email_verified": {
"type": "boolean",
"example": true,
"description": "Whether the primary email has been verified to belong to this user"
},
"primary_email_auth_enabled": {
"type": "boolean",
"example": true,
"description": "Whether the primary email is used for authentication. If this is set to `false`, the user will not be able to sign in with the primary email with password or OTP"
},
"display_name": {
"type": "string",
"example": "John Doe",
"description": "Human-readable user display name. This is not a unique identifier."
},
"selected_team": {
"type": "object",
"properties": {
"created_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the team was created (the number of milliseconds since epoch, January 1, 1970, UTC)"
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the team here."
},
"id": {
"type": "string",
"example": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"description": "The unique identifier of the team"
},
"display_name": {
"type": "string",
"example": "My Team",
"description": "Human-readable team display name. This is not a unique identifier."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for team. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
}
},
"required": [
"created_at_millis",
"id",
"display_name"
]
},
"selected_team_id": {
"type": "string",
"example": "team-id",
"description": "ID of the team currently selected by the user"
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for user. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"signed_up_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the user signed up (identify) => `(the number of milliseconds since epoch, January 1, 1970, UTC)`"
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the user here."
},
"last_active_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the user was last active (identify) => `(the number of milliseconds since epoch, January 1, 1970, UTC)`"
},
"is_anonymous": {
"type": "boolean"
},
"is_restricted": {
"type": "boolean",
"example": false,
"description": "Whether the user is in restricted state (has signed up but not completed onboarding requirements)"
},
"restricted_reason": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"anonymous",
"email_not_verified",
"restricted_by_administrator"
]
}
},
"required": [
"type"
],
"example": null,
"description": "The reason why the user is restricted (e.g., type: \"email_not_verified\", \"anonymous\", or \"restricted_by_administrator\"), null if not restricted"
},
"restricted_by_admin": {
"type": "boolean",
"example": false,
"description": "Whether the user is restricted by an administrator. Can be set manually or by sign-up rules."
},
"restricted_by_admin_reason": {
"type": "string",
"example": null,
"description": "Public reason shown to the user explaining why they are restricted. Optional."
},
"restricted_by_admin_private_details": {
"type": "string",
"example": null,
"description": "Private details about the restriction (e.g., which sign-up rule triggered). Only visible to server access and above."
},
"country_code": {
"type": "string",
"example": "US",
"description": "Best-effort ISO country code captured at sign-up time from request geo headers."
},
"risk_scores": {
"type": "object",
"properties": {
"sign_up": {
"type": "object",
"properties": {
"bot": {
"type": "integer"
},
"free_trial_abuse": {
"type": "integer"
}
},
"required": [
"bot",
"free_trial_abuse"
]
}
},
"required": [
"sign_up"
],
"example": {
"sign_up": {
"bot": 0,
"free_trial_abuse": 0
}
},
"description": "User risk scores used for sign-up risk evaluation."
}
},
"required": [
"id",
"primary_email_verified",
"primary_email_auth_enabled",
"signed_up_at_millis",
"last_active_at_millis",
"is_anonymous",
"is_restricted",
"restricted_by_admin",
"risk_scores"
]
}
}
}
}
}
}
},
"/users/{user_id}": {
"get": {
"summary": "Get user",
"description": "Gets a user by user ID.",
"parameters": [
{
"name": "user_id",
"in": "path",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": true
}
],
"tags": [
"Users"
],
"x-full-url": "https://api.stack-auth.com/api/v1/users/{user_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
},
"primary_email": {
"type": "string",
"example": "johndoe@example.com",
"description": "Primary email"
},
"primary_email_verified": {
"type": "boolean",
"example": true,
"description": "Whether the primary email has been verified to belong to this user"
},
"primary_email_auth_enabled": {
"type": "boolean",
"example": true,
"description": "Whether the primary email is used for authentication. If this is set to `false`, the user will not be able to sign in with the primary email with password or OTP"
},
"display_name": {
"type": "string",
"example": "John Doe",
"description": "Human-readable user display name. This is not a unique identifier."
},
"selected_team": {
"type": "object",
"properties": {
"created_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the team was created (the number of milliseconds since epoch, January 1, 1970, UTC)"
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the team here."
},
"id": {
"type": "string",
"example": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"description": "The unique identifier of the team"
},
"display_name": {
"type": "string",
"example": "My Team",
"description": "Human-readable team display name. This is not a unique identifier."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for team. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
}
},
"required": [
"created_at_millis",
"id",
"display_name"
]
},
"selected_team_id": {
"type": "string",
"example": "team-id",
"description": "ID of the team currently selected by the user"
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for user. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"signed_up_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the user signed up (identify) => `(the number of milliseconds since epoch, January 1, 1970, UTC)`"
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the user here."
},
"last_active_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the user was last active (identify) => `(the number of milliseconds since epoch, January 1, 1970, UTC)`"
},
"is_anonymous": {
"type": "boolean"
},
"is_restricted": {
"type": "boolean",
"example": false,
"description": "Whether the user is in restricted state (has signed up but not completed onboarding requirements)"
},
"restricted_reason": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"anonymous",
"email_not_verified",
"restricted_by_administrator"
]
}
},
"required": [
"type"
],
"example": null,
"description": "The reason why the user is restricted (e.g., type: \"email_not_verified\", \"anonymous\", or \"restricted_by_administrator\"), null if not restricted"
},
"restricted_by_admin": {
"type": "boolean",
"example": false,
"description": "Whether the user is restricted by an administrator. Can be set manually or by sign-up rules."
},
"restricted_by_admin_reason": {
"type": "string",
"example": null,
"description": "Public reason shown to the user explaining why they are restricted. Optional."
},
"restricted_by_admin_private_details": {
"type": "string",
"example": null,
"description": "Private details about the restriction (e.g., which sign-up rule triggered). Only visible to server access and above."
},
"country_code": {
"type": "string",
"example": "US",
"description": "Best-effort ISO country code captured at sign-up time from request geo headers."
},
"risk_scores": {
"type": "object",
"properties": {
"sign_up": {
"type": "object",
"properties": {
"bot": {
"type": "integer"
},
"free_trial_abuse": {
"type": "integer"
}
},
"required": [
"bot",
"free_trial_abuse"
]
}
},
"required": [
"sign_up"
],
"example": {
"sign_up": {
"bot": 0,
"free_trial_abuse": 0
}
},
"description": "User risk scores used for sign-up risk evaluation."
}
},
"required": [
"id",
"primary_email_verified",
"primary_email_auth_enabled",
"signed_up_at_millis",
"last_active_at_millis",
"is_anonymous",
"is_restricted",
"restricted_by_admin",
"risk_scores"
]
}
}
}
}
}
},
"delete": {
"summary": "Delete user",
"description": "Deletes a user. Use this with caution.",
"parameters": [
{
"name": "user_id",
"in": "path",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": true
}
],
"tags": [
"Users"
],
"x-full-url": "https://api.stack-auth.com/api/v1/users/{user_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "Always equal to true.",
"example": true
}
},
"required": [
"success"
]
}
}
}
}
}
},
"patch": {
"summary": "Update user",
"description": "Updates a user. Only the values provided will be updated.",
"parameters": [
{
"name": "user_id",
"in": "path",
"schema": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The ID of the user, or the special value `me` for the currently authenticated user"
},
"description": "The ID of the user, or the special value `me` for the currently authenticated user",
"required": true
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"display_name": {
"type": "string",
"example": "John Doe",
"description": "Human-readable user display name. This is not a unique identifier."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for user. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the user here."
},
"primary_email": {
"type": "string",
"example": "johndoe@example.com",
"description": "Primary email"
},
"primary_email_verified": {
"type": "boolean",
"example": true,
"description": "Whether the primary email has been verified to belong to this user"
},
"primary_email_auth_enabled": {
"type": "boolean",
"example": true,
"description": "Whether the primary email is used for authentication. If this is set to `false`, the user will not be able to sign in with the primary email with password or OTP"
},
"password": {
"type": "string",
"example": "my-new-password",
"description": "Sets the user's password. Doing so revokes all current sessions."
},
"password_hash": {
"type": "string",
"description": "If `password` is not given, sets the user's password hash to the given string in Modular Crypt Format (ex.: `$2a$10$VIhIOofSMqGdGlL4wzE//e.77dAQGqNtF/1dT7bqCrVtQuInWy2qi`). Doing so revokes all current sessions."
},
"totp_secret_base64": {
"type": "string",
"example": "dG90cC1zZWNyZXQ=",
"description": "Enables 2FA and sets a TOTP secret for the user. Set to null to disable 2FA."
},
"selected_team_id": {
"type": "string",
"example": "team-id",
"description": "ID of the team currently selected by the user"
},
"is_anonymous": {
"type": "boolean"
},
"restricted_by_admin": {
"type": "boolean",
"example": false,
"description": "Whether the user is restricted by an administrator. Can be set manually or by sign-up rules."
},
"restricted_by_admin_reason": {
"type": "string",
"example": null,
"description": "Public reason shown to the user explaining why they are restricted. Optional."
},
"restricted_by_admin_private_details": {
"type": "string",
"example": null,
"description": "Private details about the restriction (e.g., which sign-up rule triggered). Only visible to server access and above."
},
"country_code": {
"type": "string",
"example": "US",
"description": "Best-effort ISO country code captured at sign-up time from request geo headers."
},
"risk_scores": {
"type": "object",
"properties": {
"sign_up": {
"type": "object",
"properties": {
"bot": {
"type": "integer"
},
"free_trial_abuse": {
"type": "integer"
}
},
"required": [
"bot",
"free_trial_abuse"
]
}
},
"required": [
"sign_up"
]
}
},
"example": {
"display_name": "John Doe",
"profile_image_url": "https://example.com/image.jpg",
"client_metadata": {
"key": "value"
},
"client_read_only_metadata": {
"key": "value"
},
"server_metadata": {
"key": "value"
},
"primary_email": "johndoe@example.com",
"primary_email_verified": true,
"primary_email_auth_enabled": true,
"password": "my-new-password",
"totp_secret_base64": "dG90cC1zZWNyZXQ=",
"selected_team_id": "team-id",
"restricted_by_admin": false,
"restricted_by_admin_reason": null,
"restricted_by_admin_private_details": null,
"country_code": "US"
}
}
}
}
},
"tags": [
"Users"
],
"x-full-url": "https://api.stack-auth.com/api/v1/users/{user_id}",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "3241a285-8329-4d69-8f3d-316e08cf140c",
"description": "The unique identifier of the user"
},
"primary_email": {
"type": "string",
"example": "johndoe@example.com",
"description": "Primary email"
},
"primary_email_verified": {
"type": "boolean",
"example": true,
"description": "Whether the primary email has been verified to belong to this user"
},
"primary_email_auth_enabled": {
"type": "boolean",
"example": true,
"description": "Whether the primary email is used for authentication. If this is set to `false`, the user will not be able to sign in with the primary email with password or OTP"
},
"display_name": {
"type": "string",
"example": "John Doe",
"description": "Human-readable user display name. This is not a unique identifier."
},
"selected_team": {
"type": "object",
"properties": {
"created_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the team was created (the number of milliseconds since epoch, January 1, 1970, UTC)"
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the team here."
},
"id": {
"type": "string",
"example": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"description": "The unique identifier of the team"
},
"display_name": {
"type": "string",
"example": "My Team",
"description": "Human-readable team display name. This is not a unique identifier."
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for team. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
}
},
"required": [
"created_at_millis",
"id",
"display_name"
]
},
"selected_team_id": {
"type": "string",
"example": "team-id",
"description": "ID of the team currently selected by the user"
},
"profile_image_url": {
"type": "string",
"example": "https://example.com/image.jpg",
"description": "URL of the profile image for user. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in."
},
"signed_up_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the user signed up (identify) => `(the number of milliseconds since epoch, January 1, 1970, UTC)`"
},
"client_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client."
},
"client_read_only_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status."
},
"server_metadata": {
"type": "object",
"example": {
"key": "value"
},
"description": "Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the user here."
},
"last_active_at_millis": {
"type": "number",
"example": 1630000000000,
"description": "The time the user was last active (identify) => `(the number of milliseconds since epoch, January 1, 1970, UTC)`"
},
"is_anonymous": {
"type": "boolean"
},
"is_restricted": {
"type": "boolean",
"example": false,
"description": "Whether the user is in restricted state (has signed up but not completed onboarding requirements)"
},
"restricted_reason": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"anonymous",
"email_not_verified",
"restricted_by_administrator"
]
}
},
"required": [
"type"
],
"example": null,
"description": "The reason why the user is restricted (e.g., type: \"email_not_verified\", \"anonymous\", or \"restricted_by_administrator\"), null if not restricted"
},
"restricted_by_admin": {
"type": "boolean",
"example": false,
"description": "Whether the user is restricted by an administrator. Can be set manually or by sign-up rules."
},
"restricted_by_admin_reason": {
"type": "string",
"example": null,
"description": "Public reason shown to the user explaining why they are restricted. Optional."
},
"restricted_by_admin_private_details": {
"type": "string",
"example": null,
"description": "Private details about the restriction (e.g., which sign-up rule triggered). Only visible to server access and above."
},
"country_code": {
"type": "string",
"example": "US",
"description": "Best-effort ISO country code captured at sign-up time from request geo headers."
},
"risk_scores": {
"type": "object",
"properties": {
"sign_up": {
"type": "object",
"properties": {
"bot": {
"type": "integer"
},
"free_trial_abuse": {
"type": "integer"
}
},
"required": [
"bot",
"free_trial_abuse"
]
}
},
"required": [
"sign_up"
],
"example": {
"sign_up": {
"bot": 0,
"free_trial_abuse": 0
}
},
"description": "User risk scores used for sign-up risk evaluation."
}
},
"required": [
"id",
"primary_email_verified",
"primary_email_auth_enabled",
"signed_up_at_millis",
"last_active_at_millis",
"is_anonymous",
"is_restricted",
"restricted_by_admin",
"risk_scores"
]
}
}
}
}
}
}
}
}
}