From d5d312b46786999ba411f915eec7a6f04860e4f4 Mon Sep 17 00:00:00 2001 From: Konstantin Wohlwend Date: Thu, 9 Apr 2026 13:17:05 -0700 Subject: [PATCH] Remove openapi folder --- docs-mintlify/openapi/admin.json | 9451 --------------------------- docs-mintlify/openapi/client.json | 5723 ---------------- docs-mintlify/openapi/server.json | 8656 ------------------------ docs-mintlify/openapi/webhooks.json | 958 --- 4 files changed, 24788 deletions(-) delete mode 100644 docs-mintlify/openapi/admin.json delete mode 100644 docs-mintlify/openapi/client.json delete mode 100644 docs-mintlify/openapi/server.json delete mode 100644 docs-mintlify/openapi/webhooks.json diff --git a/docs-mintlify/openapi/admin.json b/docs-mintlify/openapi/admin.json deleted file mode 100644 index b85d21e91..000000000 --- a/docs-mintlify/openapi/admin.json +++ /dev/null @@ -1,9451 +0,0 @@ -{ - "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": { - "/internal/ai-chat/{threadId}": { - "patch": { - "summary": "Save a chat message", - "description": "Save a chat message", - "parameters": [ - { - "name": "threadId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "message": { - "type": "object" - } - }, - "required": [ - "message" - ], - "example": {} - } - } - } - }, - "tags": [ - "AI Chat" - ], - "x-full-url": "https://api.stack-auth.com/api/v1/internal/ai-chat/{threadId}", - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": {} - } - } - } - } - } - } - }, - "/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" - }, - "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" - }, - "team_id": { - "type": "string" - } - }, - "required": [ - "value", - "id", - "description", - "created_at_millis", - "is_public", - "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" - }, - "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" - }, - "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" - ] - } - } - } - } - } - } - }, - "/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" - }, - "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" - }, - "team_id": { - "type": "string" - } - }, - "required": [ - "id", - "description", - "created_at_millis", - "is_public", - "value", - "type", - "team_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" - }, - "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" - ] - } - } - } - } - } - } - }, - "/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" - }, - "team_id": { - "type": "string" - } - }, - "required": [ - "id", - "description", - "created_at_millis", - "is_public", - "value", - "type", - "team_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" - }, - "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" - }, - "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": 7200000 - } - }, - "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/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" - }, - "refresh_token": { - "type": "string" - } - }, - "required": [ - "status" - ] - } - } - } - }, - "201": { - "description": "Successful response", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "status": { - "type": "string" - }, - "refresh_token": { - "type": "string" - } - }, - "required": [ - "status" - ] - } - } - } - } - } - } - }, - "/auth/cli/complete": { - "post": { - "summary": "Complete CLI authentication", - "description": "Set the refresh token for a CLI authentication session using the login code", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "login_code": { - "type": "string" - }, - "refresh_token": { - "type": "string" - } - }, - "required": [ - "login_code", - "refresh_token" - ], - "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", - "description": "Always equal to true.", - "example": true - } - }, - "required": [ - "success" - ] - } - } - } - } - } - } - }, - "/internal/config": { - "get": { - "summary": "Get the config", - "description": "Get the config for a project and branch", - "parameters": [], - "tags": [ - "Config" - ], - "x-full-url": "https://api.stack-auth.com/api/v1/internal/config", - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "config_string": { - "type": "string" - } - }, - "required": [ - "config_string" - ] - } - } - } - } - } - } - }, - "/internal/config/override": { - "patch": { - "summary": "Update the config", - "description": "Update the config for a project and branch with an override", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "config_override_string": { - "type": "string" - } - }, - "example": {} - } - } - } - }, - "tags": [ - "Config" - ], - "x-full-url": "https://api.stack-auth.com/api/v1/internal/config/override", - "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": { - "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", - "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", - "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", - "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", - "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", - "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", - "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/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" - ] - } - } - } - } - } - } - }, - "/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/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" - }, - "penalty_factor": { - "type": "number" - } - }, - "required": [ - "rate_per_second", - "penalty_factor" - ] - } - }, - "required": [ - "stats", - "capacity" - ] - } - } - } - } - } - } - }, - "/emails/render-email": { - "post": { - "summary": "Render email theme", - "description": "Renders HTML content using the specified email theme", - "parameters": [], - "tags": [ - "Emails" - ], - "x-full-url": "https://api.stack-auth.com/api/v1/emails/render-email", - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "html": { - "type": "string" - }, - "subject": { - "type": "string" - }, - "notification_category": { - "type": "string" - } - }, - "required": [ - "html" - ] - } - } - } - } - } - } - }, - "/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/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/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" - ] - } - } - } - } - } - } - }, - "/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" - ] - } - } - } - } - } - } - }, - "/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", - "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", - "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", - "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", - "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" - ] - } - } - } - } - } - } - }, - "/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" - } - }, - "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": {} - } - } - } - } - } - }, - "/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", - "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": "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" - }, - "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": { - "302": { - "description": "No content" - } - } - } - }, - "/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." - } - }, - "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/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" - }, - "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/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/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." - } - }, - "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/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/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" - ] - } - } - } - } - } - } - }, - "/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/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" - } - }, - "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/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" - ] - } - } - } - } - } - } - }, - "/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" - }, - "free_trial": { - "type": "array", - "items": { - "type": "number" - } - }, - "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" - ] - } - } - } - } - } - } - }, - "/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", - "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" - }, - "free_trial": { - "type": "array", - "items": { - "type": "number" - } - }, - "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": "number", - "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": "The Stripe client secret for completing the payment" - } - }, - "required": [ - "client_secret" - ] - } - } - } - } - } - } - }, - "/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", - "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", - "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", - "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": "number", - "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": {} - } - } - } - } - } - } - }, - "/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", - "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-permission-definitions": { - "get": { - "summary": "List team permission definitions", - "description": "Query and filter the permission with team_id, user_id, and permission_id (the equivalent of listing permissions on the Stack dashboard)", - "parameters": [], - "tags": [ - "Permissions" - ], - "x-full-url": "https://api.stack-auth.com/api/v1/team-permission-definitions", - "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`" - }, - "description": { - "type": "string", - "example": "Read secret information", - "description": "A human-readable description of the permission" - }, - "contained_permission_ids": { - "type": "array", - "items": { - "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`" - }, - "example": [ - "read_public_info" - ], - "description": "The IDs of the permissions that are contained in this permission" - } - }, - "required": [ - "id", - "contained_permission_ids" - ] - } - }, - "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 new team permission definition", - "description": "Create a new permission definition (the equivalent of creating a new permission on the Stack dashboard)", - "parameters": [], - "requestBody": { - "required": true, - "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 only contain lowercase letters, numbers, \":\", and \"_\" characters" - }, - "description": { - "type": "string", - "example": "Read secret information", - "description": "A human-readable description of the permission" - }, - "contained_permission_ids": { - "type": "array", - "items": { - "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`" - }, - "example": [ - "read_public_info" - ], - "description": "The IDs of the permissions that are contained in this permission" - } - }, - "required": [ - "id" - ], - "example": { - "id": "read_secret_info", - "description": "Read secret information", - "contained_permission_ids": [ - "read_public_info" - ] - } - } - } - } - }, - "tags": [ - "Permissions" - ], - "x-full-url": "https://api.stack-auth.com/api/v1/team-permission-definitions", - "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`" - }, - "description": { - "type": "string", - "example": "Read secret information", - "description": "A human-readable description of the permission" - }, - "contained_permission_ids": { - "type": "array", - "items": { - "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`" - }, - "example": [ - "read_public_info" - ], - "description": "The IDs of the permissions that are contained in this permission" - } - }, - "required": [ - "id", - "contained_permission_ids" - ] - } - } - } - } - } - } - }, - "/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", - "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-permission-definitions": { - "get": { - "summary": "List project permission definitions", - "description": "Query and filter project permission definitions (the equivalent of listing permissions on the Stack dashboard)", - "parameters": [], - "tags": [ - "Permissions" - ], - "x-full-url": "https://api.stack-auth.com/api/v1/project-permission-definitions", - "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`" - }, - "description": { - "type": "string", - "example": "Read secret information", - "description": "A human-readable description of the permission" - }, - "contained_permission_ids": { - "type": "array", - "items": { - "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`" - }, - "example": [ - "read_public_info" - ], - "description": "The IDs of the permissions that are contained in this permission" - } - }, - "required": [ - "id", - "contained_permission_ids" - ] - } - }, - "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 new project permission definition", - "description": "Create a new project permission definition (the equivalent of creating a new permission on the Stack dashboard)", - "parameters": [], - "requestBody": { - "required": true, - "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 only contain lowercase letters, numbers, \":\", and \"_\" characters" - }, - "description": { - "type": "string", - "example": "Read secret information", - "description": "A human-readable description of the permission" - }, - "contained_permission_ids": { - "type": "array", - "items": { - "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`" - }, - "example": [ - "read_public_info" - ], - "description": "The IDs of the permissions that are contained in this permission" - } - }, - "required": [ - "id" - ], - "example": { - "id": "read_secret_info", - "description": "Read secret information", - "contained_permission_ids": [ - "read_public_info" - ] - } - } - } - } - }, - "tags": [ - "Permissions" - ], - "x-full-url": "https://api.stack-auth.com/api/v1/project-permission-definitions", - "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`" - }, - "description": { - "type": "string", - "example": "Read secret information", - "description": "A human-readable description of the permission" - }, - "contained_permission_ids": { - "type": "array", - "items": { - "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`" - }, - "example": [ - "read_public_info" - ], - "description": "The IDs of the permissions that are contained in this permission" - } - }, - "required": [ - "id", - "contained_permission_ids" - ] - } - } - } - } - } - } - }, - "/team-permission-definitions/{permission_id}": { - "delete": { - "summary": "Delete a team permission definition", - "description": "Delete a permission definition (the equivalent of deleting a permission on the Stack dashboard)", - "parameters": [ - { - "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-permission-definitions/{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" - ] - } - } - } - } - } - }, - "patch": { - "summary": "Update a team permission definition", - "description": "Update a permission definition (the equivalent of updating a permission on the Stack dashboard)", - "parameters": [ - { - "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 - } - ], - "requestBody": { - "required": true, - "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 only contain lowercase letters, numbers, \":\", and \"_\" characters" - }, - "description": { - "type": "string", - "example": "Read secret information", - "description": "A human-readable description of the permission" - }, - "contained_permission_ids": { - "type": "array", - "items": { - "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`" - }, - "example": [ - "read_public_info" - ], - "description": "The IDs of the permissions that are contained in this permission" - } - }, - "example": { - "id": "read_secret_info", - "description": "Read secret information", - "contained_permission_ids": [ - "read_public_info" - ] - } - } - } - } - }, - "tags": [ - "Permissions" - ], - "x-full-url": "https://api.stack-auth.com/api/v1/team-permission-definitions/{permission_id}", - "responses": { - "200": { - "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`" - }, - "description": { - "type": "string", - "example": "Read secret information", - "description": "A human-readable description of the permission" - }, - "contained_permission_ids": { - "type": "array", - "items": { - "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`" - }, - "example": [ - "read_public_info" - ], - "description": "The IDs of the permissions that are contained in this permission" - } - }, - "required": [ - "id", - "contained_permission_ids" - ] - } - } - } - } - } - } - }, - "/project-permission-definitions/{permission_id}": { - "delete": { - "summary": "Delete a project permission definition", - "description": "Delete a project permission definition (the equivalent of deleting a permission on the Stack dashboard)", - "parameters": [ - { - "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-permission-definitions/{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" - ] - } - } - } - } - } - }, - "patch": { - "summary": "Update a project permission definition", - "description": "Update a project permission definition (the equivalent of updating a permission on the Stack dashboard)", - "parameters": [ - { - "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 - } - ], - "requestBody": { - "required": true, - "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 only contain lowercase letters, numbers, \":\", and \"_\" characters" - }, - "description": { - "type": "string", - "example": "Read secret information", - "description": "A human-readable description of the permission" - }, - "contained_permission_ids": { - "type": "array", - "items": { - "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`" - }, - "example": [ - "read_public_info" - ], - "description": "The IDs of the permissions that are contained in this permission" - } - }, - "example": { - "id": "read_secret_info", - "description": "Read secret information", - "contained_permission_ids": [ - "read_public_info" - ] - } - } - } - } - }, - "tags": [ - "Permissions" - ], - "x-full-url": "https://api.stack-auth.com/api/v1/project-permission-definitions/{permission_id}", - "responses": { - "200": { - "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`" - }, - "description": { - "type": "string", - "example": "Read secret information", - "description": "A human-readable description of the permission" - }, - "contained_permission_ids": { - "type": "array", - "items": { - "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`" - }, - "example": [ - "read_public_info" - ], - "description": "The IDs of the permissions that are contained in this permission" - } - }, - "required": [ - "id", - "contained_permission_ids" - ] - } - } - } - } - } - } - }, - "/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/{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/{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" - ] - } - } - } - } - } - } - }, - "/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" - ] - } - } - } - } - } - } - }, - "/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 - } - ], - "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" - ] - } - } - } - } - } - } - }, - "/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" - } - }, - "required": [ - "id", - "primary_email_verified", - "primary_email_auth_enabled", - "signed_up_at_millis", - "last_active_at_millis", - "is_anonymous" - ] - }, - "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-invitations": { - "get": { - "summary": "List team invitations", - "description": "", - "parameters": [ - { - "name": "team_id", - "in": "query", - "schema": { - "type": "string" - }, - "required": true - } - ], - "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" - }, - "expires_at_millis": { - "type": "number" - }, - "recipient_email": { - "type": "string" - } - }, - "required": [ - "id", - "team_id", - "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" - ] - } - } - } - } - } - } - }, - "/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" - ] - } - } - } - } - } - } - }, - "/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/{id}": { - "delete": { - "summary": "Delete a team invitation", - "description": "", - "parameters": [ - { - "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/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-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" - } - }, - "required": [ - "id", - "primary_email_verified", - "primary_email_auth_enabled", - "signed_up_at_millis", - "last_active_at_millis", - "is_anonymous" - ] - }, - "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" - } - }, - "required": [ - "id", - "primary_email_verified", - "primary_email_auth_enabled", - "signed_up_at_millis", - "last_active_at_millis", - "is_anonymous" - ] - }, - "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-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-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" - ] - } - } - } - } - } - } - }, - "/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" - ] - } - } - } - } - } - } - }, - "/users": { - "get": { - "summary": "List users", - "description": "Lists all the users in the project. Anonymous users are only included if the `include_anonymous` query parameter is set to `true`.", - "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": "number", - "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", - "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", - "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", - "description": "Whether to include anonymous users in the results. Defaults to false" - }, - "description": "Whether to include anonymous 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" - } - }, - "required": [ - "id", - "primary_email_verified", - "primary_email_auth_enabled", - "signed_up_at_millis", - "last_active_at_millis", - "is_anonymous" - ] - } - }, - "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." - } - }, - "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=" - } - } - } - } - }, - "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" - } - }, - "required": [ - "id", - "primary_email_verified", - "primary_email_auth_enabled", - "signed_up_at_millis", - "last_active_at_millis", - "is_anonymous" - ] - } - } - } - } - } - } - }, - "/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" - } - }, - "required": [ - "id", - "primary_email_verified", - "primary_email_auth_enabled", - "signed_up_at_millis", - "last_active_at_millis", - "is_anonymous" - ] - } - } - } - } - } - }, - "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" - } - }, - "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" - } - } - } - } - }, - "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" - } - }, - "required": [ - "id", - "primary_email_verified", - "primary_email_auth_enabled", - "signed_up_at_millis", - "last_active_at_millis", - "is_anonymous" - ] - } - } - } - } - } - } - }, - "/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" - } - }, - "required": [ - "id", - "primary_email_verified", - "primary_email_auth_enabled", - "signed_up_at_millis", - "last_active_at_millis", - "is_anonymous" - ] - } - } - } - } - } - }, - "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" - } - }, - "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" - } - } - } - } - }, - "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" - } - }, - "required": [ - "id", - "primary_email_verified", - "primary_email_auth_enabled", - "signed_up_at_millis", - "last_active_at_millis", - "is_anonymous" - ] - } - } - } - } - } - } - }, - "/": { - "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" - }, - "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" - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/docs-mintlify/openapi/client.json b/docs-mintlify/openapi/client.json deleted file mode 100644 index c5f13d3ff..000000000 --- a/docs-mintlify/openapi/client.json +++ /dev/null @@ -1,5723 +0,0 @@ -{ - "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": { - "/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" - }, - "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" - }, - "team_id": { - "type": "string" - } - }, - "required": [ - "value", - "id", - "description", - "created_at_millis", - "is_public", - "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" - }, - "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" - }, - "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" - ] - } - } - } - } - } - } - }, - "/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" - }, - "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" - }, - "team_id": { - "type": "string" - } - }, - "required": [ - "id", - "description", - "created_at_millis", - "is_public", - "value", - "type", - "team_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" - }, - "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" - }, - "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": 7200000 - } - }, - "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/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" - }, - "refresh_token": { - "type": "string" - } - }, - "required": [ - "status" - ] - } - } - } - }, - "201": { - "description": "Successful response", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "status": { - "type": "string" - }, - "refresh_token": { - "type": "string" - } - }, - "required": [ - "status" - ] - } - } - } - } - } - } - }, - "/auth/cli/complete": { - "post": { - "summary": "Complete CLI authentication", - "description": "Set the refresh token for a CLI authentication session using the login code", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "login_code": { - "type": "string" - }, - "refresh_token": { - "type": "string" - } - }, - "required": [ - "login_code", - "refresh_token" - ], - "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", - "description": "Always equal to true.", - "example": true - } - }, - "required": [ - "success" - ] - } - } - } - } - } - } - }, - "/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", - "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": { - "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", - "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": { - "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", - "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", - "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": { - "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", - "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": { - "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", - "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" - ] - } - } - } - } - } - } - }, - "/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" - ] - } - } - } - } - } - } - }, - "/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" - ] - } - } - } - } - } - } - }, - "/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": { - "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", - "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": [ - "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" - ] - } - } - } - } - } - } - }, - "/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": { - "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", - "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": [ - "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 for a 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 - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "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": { - "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": { - "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", - "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": [ - "user_id", - "id", - "provider_config_id", - "type", - "allow_sign_in", - "allow_connected_accounts" - ] - } - } - } - } - } - } - }, - "/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" - } - }, - "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": {} - } - } - } - } - } - }, - "/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", - "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": "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" - }, - "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": { - "302": { - "description": "No content" - } - } - } - }, - "/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." - } - }, - "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/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" - }, - "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/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/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." - } - }, - "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/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/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" - ] - } - } - } - } - } - } - }, - "/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/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" - } - }, - "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/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" - ] - } - } - } - } - } - } - }, - "/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" - }, - "free_trial": { - "type": "array", - "items": { - "type": "number" - } - }, - "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" - ] - } - } - } - } - } - } - }, - "/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", - "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" - }, - "free_trial": { - "type": "array", - "items": { - "type": "number" - } - }, - "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": "number", - "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": "The Stripe client secret for completing the payment" - } - }, - "required": [ - "client_secret" - ] - } - } - } - } - } - } - }, - "/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", - "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" - ] - } - } - } - } - } - } - }, - "/team-permissions": { - "get": { - "summary": "List team permissions", - "description": "List team permissions of the current user. `user_id=me` must be set for client requests. Note that this might contain the permissions with the same permission ID across different teams. `(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", - "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" - ] - } - } - } - } - } - } - }, - "/project-permissions": { - "get": { - "summary": "List project permissions", - "description": "List global permissions of the current user. `user_id=me` must be set for client requests. `(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", - "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" - ] - } - } - } - } - } - } - }, - "/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" - ] - } - } - } - } - } - } - }, - "/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" - ] - } - } - } - } - } - } - }, - "/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" - ] - } - } - } - } - } - } - }, - "/teams": { - "get": { - "summary": "List teams", - "description": "List all the teams that the current user is a member of. `user_id=me` must be passed in the query parameters.", - "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 - } - ], - "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": { - "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": [ - "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." - }, - "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", - "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": { - "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": [ - "id", - "display_name" - ] - } - } - } - } - } - } - }, - "/team-member-profiles": { - "get": { - "summary": "List team members profiles", - "description": "List team members profiles. You always need to specify a `team_id` that your are a member of on the client. You can always filter for your own profile by setting `me` as the `user_id` in the path parameters. If you want list all the profiles in a team, you need to have the `$read_members` permission in that team.", - "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": { - "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": [ - "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-invitations": { - "get": { - "summary": "List team invitations", - "description": "", - "parameters": [ - { - "name": "team_id", - "in": "query", - "schema": { - "type": "string" - }, - "required": true - } - ], - "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" - }, - "expires_at_millis": { - "type": "number" - }, - "recipient_email": { - "type": "string" - } - }, - "required": [ - "id", - "team_id", - "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" - ] - } - } - } - } - } - } - }, - "/teams/{team_id}": { - "get": { - "summary": "Get a team", - "description": "Get a team that the current user is a member of.", - "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": { - "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": [ - "id", - "display_name" - ] - } - } - } - } - } - }, - "delete": { - "summary": "Delete a team", - "description": "Delete a team. Only allowed if the current user is a member of the team and has the `$delete_team` permission.", - "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. Only allowed if the current user is a member of the team and has the `$update_team` permission.", - "parameters": [ - { - "name": "team_id", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - } - ], - "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." - }, - "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": { - "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": { - "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": [ - "id", - "display_name" - ] - } - } - } - } - } - } - }, - "/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/{id}": { - "delete": { - "summary": "Delete a team invitation", - "description": "", - "parameters": [ - { - "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/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-member-profiles/{team_id}/{user_id}": { - "get": { - "summary": "Get a team member profile", - "description": "Get a team member profile. you can always get your own profile by setting `me` as the `user_id` in the path parameters on the client. If you want to get someone else's profile in a team, you need to have the `$read_members` permission in that team.", - "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": { - "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": [ - "team_id", - "user_id" - ] - } - } - } - } - } - }, - "patch": { - "summary": "Update your team member profile", - "description": "Update your own team member profile. `user_id` must be `me` in the path parameters on the client.", - "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": { - "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": [ - "team_id", - "user_id" - ] - } - } - } - } - } - } - }, - "/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-memberships/{team_id}/{user_id}": { - "delete": { - "summary": "Remove a user from a team", - "description": "All the users are allowed to remove themselves from a team (`user_id=me`). Only the users who have the `$remove_members` permission are allowed to remove other users from a team. `team_id` is must an ID of a team that the user is a member of.", - "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" - ] - } - } - } - } - } - } - }, - "/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" - ] - } - } - } - } - } - } - }, - "/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": { - "selected_team": { - "type": "object", - "properties": { - "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": [ - "id", - "display_name" - ] - }, - "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" - }, - "display_name": { - "type": "string", - "example": "John Doe", - "description": "Human-readable user display name. This is not a unique identifier." - }, - "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." - }, - "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)`" - }, - "selected_team_id": { - "type": "string", - "example": "team-id", - "description": "ID of the team currently selected by the user" - }, - "is_anonymous": { - "type": "boolean" - } - }, - "required": [ - "id", - "primary_email_verified", - "signed_up_at_millis", - "is_anonymous" - ] - } - } - } - } - } - }, - "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." - }, - "selected_team_id": { - "type": "string", - "example": "team-id", - "description": "ID of the team currently selected by the user" - }, - "totp_secret_base64": { - "type": "string", - "example": "dG90cC1zZWNyZXQ=", - "description": "Enables 2FA and sets a TOTP secret for the user. Set to null to disable 2FA." - } - }, - "example": { - "display_name": "John Doe", - "profile_image_url": "https://example.com/image.jpg", - "client_metadata": { - "key": "value" - }, - "selected_team_id": "team-id", - "totp_secret_base64": "dG90cC1zZWNyZXQ=" - } - } - } - } - }, - "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": { - "selected_team": { - "type": "object", - "properties": { - "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": [ - "id", - "display_name" - ] - }, - "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" - }, - "display_name": { - "type": "string", - "example": "John Doe", - "description": "Human-readable user display name. This is not a unique identifier." - }, - "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." - }, - "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)`" - }, - "selected_team_id": { - "type": "string", - "example": "team-id", - "description": "ID of the team currently selected by the user" - }, - "is_anonymous": { - "type": "boolean" - } - }, - "required": [ - "id", - "primary_email_verified", - "signed_up_at_millis", - "is_anonymous" - ] - } - } - } - } - } - } - }, - "/": { - "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" - }, - "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" - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/docs-mintlify/openapi/server.json b/docs-mintlify/openapi/server.json deleted file mode 100644 index 2abc9a57e..000000000 --- a/docs-mintlify/openapi/server.json +++ /dev/null @@ -1,8656 +0,0 @@ -{ - "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": { - "/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" - }, - "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" - }, - "team_id": { - "type": "string" - } - }, - "required": [ - "value", - "id", - "description", - "created_at_millis", - "is_public", - "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" - }, - "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" - }, - "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" - ] - } - } - } - } - } - } - }, - "/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" - }, - "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" - }, - "team_id": { - "type": "string" - } - }, - "required": [ - "id", - "description", - "created_at_millis", - "is_public", - "value", - "type", - "team_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" - }, - "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" - ] - } - } - } - } - } - } - }, - "/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" - }, - "team_id": { - "type": "string" - } - }, - "required": [ - "id", - "description", - "created_at_millis", - "is_public", - "value", - "type", - "team_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" - }, - "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" - }, - "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": 7200000 - } - }, - "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/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" - }, - "refresh_token": { - "type": "string" - } - }, - "required": [ - "status" - ] - } - } - } - }, - "201": { - "description": "Successful response", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "status": { - "type": "string" - }, - "refresh_token": { - "type": "string" - } - }, - "required": [ - "status" - ] - } - } - } - } - } - } - }, - "/auth/cli/complete": { - "post": { - "summary": "Complete CLI authentication", - "description": "Set the refresh token for a CLI authentication session using the login code", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "login_code": { - "type": "string" - }, - "refresh_token": { - "type": "string" - } - }, - "required": [ - "login_code", - "refresh_token" - ], - "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", - "description": "Always equal to true.", - "example": true - } - }, - "required": [ - "success" - ] - } - } - } - } - } - } - }, - "/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", - "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", - "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", - "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", - "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", - "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", - "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/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" - ] - } - } - } - } - } - } - }, - "/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/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" - }, - "penalty_factor": { - "type": "number" - } - }, - "required": [ - "rate_per_second", - "penalty_factor" - ] - } - }, - "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/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/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" - ] - } - } - } - } - } - } - }, - "/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" - ] - } - } - } - } - } - } - }, - "/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", - "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", - "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", - "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", - "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" - ] - } - } - } - } - } - } - }, - "/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" - } - }, - "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": {} - } - } - } - } - } - }, - "/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", - "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": "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" - }, - "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": { - "302": { - "description": "No content" - } - } - } - }, - "/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." - } - }, - "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/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" - }, - "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/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/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." - } - }, - "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/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/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" - ] - } - } - } - } - } - } - }, - "/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/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" - } - }, - "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/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" - ] - } - } - } - } - } - } - }, - "/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" - }, - "free_trial": { - "type": "array", - "items": { - "type": "number" - } - }, - "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" - ] - } - } - } - } - } - } - }, - "/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", - "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" - }, - "free_trial": { - "type": "array", - "items": { - "type": "number" - } - }, - "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": "number", - "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": "The Stripe client secret for completing the payment" - } - }, - "required": [ - "client_secret" - ] - } - } - } - } - } - } - }, - "/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", - "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", - "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", - "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": "number", - "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": {} - } - } - } - } - } - } - }, - "/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", - "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" - ] - } - } - } - } - } - } - }, - "/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", - "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/{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/{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" - ] - } - } - } - } - } - } - }, - "/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" - ] - } - } - } - } - } - } - }, - "/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 - } - ], - "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" - ] - } - } - } - } - } - } - }, - "/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" - } - }, - "required": [ - "id", - "primary_email_verified", - "primary_email_auth_enabled", - "signed_up_at_millis", - "last_active_at_millis", - "is_anonymous" - ] - }, - "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-invitations": { - "get": { - "summary": "List team invitations", - "description": "", - "parameters": [ - { - "name": "team_id", - "in": "query", - "schema": { - "type": "string" - }, - "required": true - } - ], - "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" - }, - "expires_at_millis": { - "type": "number" - }, - "recipient_email": { - "type": "string" - } - }, - "required": [ - "id", - "team_id", - "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" - ] - } - } - } - } - } - } - }, - "/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" - ] - } - } - } - } - } - } - }, - "/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/{id}": { - "delete": { - "summary": "Delete a team invitation", - "description": "", - "parameters": [ - { - "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/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-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" - } - }, - "required": [ - "id", - "primary_email_verified", - "primary_email_auth_enabled", - "signed_up_at_millis", - "last_active_at_millis", - "is_anonymous" - ] - }, - "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" - } - }, - "required": [ - "id", - "primary_email_verified", - "primary_email_auth_enabled", - "signed_up_at_millis", - "last_active_at_millis", - "is_anonymous" - ] - }, - "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-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-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" - ] - } - } - } - } - } - } - }, - "/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" - ] - } - } - } - } - } - } - }, - "/users": { - "get": { - "summary": "List users", - "description": "Lists all the users in the project. Anonymous users are only included if the `include_anonymous` query parameter is set to `true`.", - "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": "number", - "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", - "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", - "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", - "description": "Whether to include anonymous users in the results. Defaults to false" - }, - "description": "Whether to include anonymous 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" - } - }, - "required": [ - "id", - "primary_email_verified", - "primary_email_auth_enabled", - "signed_up_at_millis", - "last_active_at_millis", - "is_anonymous" - ] - } - }, - "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." - } - }, - "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=" - } - } - } - } - }, - "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" - } - }, - "required": [ - "id", - "primary_email_verified", - "primary_email_auth_enabled", - "signed_up_at_millis", - "last_active_at_millis", - "is_anonymous" - ] - } - } - } - } - } - } - }, - "/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" - } - }, - "required": [ - "id", - "primary_email_verified", - "primary_email_auth_enabled", - "signed_up_at_millis", - "last_active_at_millis", - "is_anonymous" - ] - } - } - } - } - } - }, - "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" - } - }, - "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" - } - } - } - } - }, - "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" - } - }, - "required": [ - "id", - "primary_email_verified", - "primary_email_auth_enabled", - "signed_up_at_millis", - "last_active_at_millis", - "is_anonymous" - ] - } - } - } - } - } - } - }, - "/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" - } - }, - "required": [ - "id", - "primary_email_verified", - "primary_email_auth_enabled", - "signed_up_at_millis", - "last_active_at_millis", - "is_anonymous" - ] - } - } - } - } - } - }, - "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" - } - }, - "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" - } - } - } - } - }, - "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" - } - }, - "required": [ - "id", - "primary_email_verified", - "primary_email_auth_enabled", - "signed_up_at_millis", - "last_active_at_millis", - "is_anonymous" - ] - } - } - } - } - } - } - }, - "/": { - "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" - }, - "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" - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/docs-mintlify/openapi/webhooks.json b/docs-mintlify/openapi/webhooks.json deleted file mode 100644 index 96c38de5a..000000000 --- a/docs-mintlify/openapi/webhooks.json +++ /dev/null @@ -1,958 +0,0 @@ -{ - "openapi": "3.1.0", - "info": { - "title": "Stack Webhooks API", - "version": "1.0.0" - }, - "webhooks": { - "user.created": { - "post": { - "summary": "user.created", - "description": "This event is triggered when a user is created.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "type": { - "type": "string", - "example": "user.created", - "description": "user.created" - }, - "data": { - "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" - } - }, - "required": [ - "id", - "primary_email_verified", - "primary_email_auth_enabled", - "signed_up_at_millis", - "last_active_at_millis", - "is_anonymous" - ] - } - }, - "required": [ - "type", - "data" - ], - "example": { - "type": "user.created" - } - } - } - } - }, - "tags": [ - "Users" - ], - "x-full-url": "https://api.stack-auth.com/api/v1/webhooks/user.created", - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "operationId": "user.created" - } - }, - "user.updated": { - "post": { - "summary": "user.updated", - "description": "This event is triggered when a user is updated.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "type": { - "type": "string", - "example": "user.updated", - "description": "user.updated" - }, - "data": { - "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" - } - }, - "required": [ - "id", - "primary_email_verified", - "primary_email_auth_enabled", - "signed_up_at_millis", - "last_active_at_millis", - "is_anonymous" - ] - } - }, - "required": [ - "type", - "data" - ], - "example": { - "type": "user.updated" - } - } - } - } - }, - "tags": [ - "Users" - ], - "x-full-url": "https://api.stack-auth.com/api/v1/webhooks/user.updated", - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "operationId": "user.updated" - } - }, - "user.deleted": { - "post": { - "summary": "user.deleted", - "description": "This event is triggered when a user is deleted.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "type": { - "type": "string", - "example": "user.deleted", - "description": "user.deleted" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "3241a285-8329-4d69-8f3d-316e08cf140c", - "description": "The unique identifier of the user" - }, - "teams": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - } - }, - "required": [ - "id" - ] - } - } - }, - "required": [ - "id", - "teams" - ] - } - }, - "required": [ - "type", - "data" - ], - "example": { - "type": "user.deleted" - } - } - } - } - }, - "tags": [ - "Users" - ], - "x-full-url": "https://api.stack-auth.com/api/v1/webhooks/user.deleted", - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "operationId": "user.deleted" - } - }, - "team.created": { - "post": { - "summary": "team.created", - "description": "This event is triggered when a team is created.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "type": { - "type": "string", - "example": "team.created", - "description": "team.created" - }, - "data": { - "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" - ] - } - }, - "required": [ - "type", - "data" - ], - "example": { - "type": "team.created" - } - } - } - } - }, - "tags": [ - "Teams" - ], - "x-full-url": "https://api.stack-auth.com/api/v1/webhooks/team.created", - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "operationId": "team.created" - } - }, - "team.updated": { - "post": { - "summary": "team.updated", - "description": "This event is triggered when a team is updated.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "type": { - "type": "string", - "example": "team.updated", - "description": "team.updated" - }, - "data": { - "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" - ] - } - }, - "required": [ - "type", - "data" - ], - "example": { - "type": "team.updated" - } - } - } - } - }, - "tags": [ - "Teams" - ], - "x-full-url": "https://api.stack-auth.com/api/v1/webhooks/team.updated", - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "operationId": "team.updated" - } - }, - "team.deleted": { - "post": { - "summary": "team.deleted", - "description": "This event is triggered when a team is deleted.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "type": { - "type": "string", - "example": "team.deleted", - "description": "team.deleted" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "3241a285-8329-4d69-8f3d-316e08cf140c", - "description": "The unique identifier of the user" - } - }, - "required": [ - "id" - ] - } - }, - "required": [ - "type", - "data" - ], - "example": { - "type": "team.deleted" - } - } - } - } - }, - "tags": [ - "Teams" - ], - "x-full-url": "https://api.stack-auth.com/api/v1/webhooks/team.deleted", - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "operationId": "team.deleted" - } - }, - "team_membership.created": { - "post": { - "summary": "team_membership.created", - "description": "This event is triggered when a user is added to a team.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "type": { - "type": "string", - "example": "team_membership.created", - "description": "team_membership.created" - }, - "data": { - "type": "object", - "properties": { - "team_id": { - "type": "string" - }, - "user_id": { - "type": "string" - } - }, - "required": [ - "team_id", - "user_id" - ] - } - }, - "required": [ - "type", - "data" - ], - "example": { - "type": "team_membership.created" - } - } - } - } - }, - "tags": [ - "Teams" - ], - "x-full-url": "https://api.stack-auth.com/api/v1/webhooks/team_membership.created", - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "operationId": "team_membership.created" - } - }, - "team_membership.deleted": { - "post": { - "summary": "team_membership.deleted", - "description": "This event is triggered when a user is removed from a team.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "type": { - "type": "string", - "example": "team_membership.deleted", - "description": "team_membership.deleted" - }, - "data": { - "type": "object", - "properties": { - "team_id": { - "type": "string" - }, - "user_id": { - "type": "string" - } - }, - "required": [ - "team_id", - "user_id" - ] - } - }, - "required": [ - "type", - "data" - ], - "example": { - "type": "team_membership.deleted" - } - } - } - } - }, - "tags": [ - "Teams" - ], - "x-full-url": "https://api.stack-auth.com/api/v1/webhooks/team_membership.deleted", - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "operationId": "team_membership.deleted" - } - }, - "team_permission.created": { - "post": { - "summary": "team_permission.created", - "description": "This event is triggered when a team permission is created.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "type": { - "type": "string", - "example": "team_permission.created", - "description": "team_permission.created" - }, - "data": { - "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" - ] - } - }, - "required": [ - "type", - "data" - ], - "example": { - "type": "team_permission.created" - } - } - } - } - }, - "tags": [ - "Teams" - ], - "x-full-url": "https://api.stack-auth.com/api/v1/webhooks/team_permission.created", - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "operationId": "team_permission.created" - } - }, - "team_permission.deleted": { - "post": { - "summary": "team_permission.deleted", - "description": "This event is triggered when a team permission is deleted.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "type": { - "type": "string", - "example": "team_permission.deleted", - "description": "team_permission.deleted" - }, - "data": { - "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" - ] - } - }, - "required": [ - "type", - "data" - ], - "example": { - "type": "team_permission.deleted" - } - } - } - } - }, - "tags": [ - "Teams" - ], - "x-full-url": "https://api.stack-auth.com/api/v1/webhooks/team_permission.deleted", - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "operationId": "team_permission.deleted" - } - } - } -} \ No newline at end of file