{ "openapi": "3.0.3", "info": { "title": "Basilic API", "version": "1.0.0", "description": "Basilic API documentation" }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer" }, "apiKeyAuth": { "type": "apiKey", "in": "header", "name": "X-API-Key" } }, "schemas": {} }, "paths": { "/health": { "get": { "operationId": "healthCheck", "summary": "Returns server health status with current ISO datetime", "tags": [ "health" ], "description": "Health check endpoint", "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "ok", "dbReady" ], "properties": { "ok": { "type": "boolean" }, "dbReady": { "type": "boolean" } } } } } } } } }, "/account/apikeys/": { "post": { "operationId": "accountApikeysCreate", "summary": "Create API key", "tags": [ "account" ], "description": "Create API key (shown once)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "name" ], "properties": { "name": { "minLength": 1, "maxLength": 64, "type": "string" } } } } } }, "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "name", "key", "prefix", "createdAt" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "key": { "type": "string" }, "prefix": { "type": "string" }, "createdAt": { "format": "date-time", "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } }, "get": { "operationId": "accountApikeysList", "summary": "List API keys", "tags": [ "account" ], "description": "List API keys for authenticated user", "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "keys" ], "properties": { "keys": { "maxItems": 50, "type": "array", "items": { "type": "object", "required": [ "id", "name", "prefix", "lastUsedAt", "expiresAt", "createdAt" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "prefix": { "type": "string" }, "lastUsedAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "expiresAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "createdAt": { "format": "date-time", "type": "string" } } } } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/account/apikeys/{id}": { "delete": { "operationId": "accountApikeysRevoke", "summary": "Revoke API key", "tags": [ "account" ], "description": "Revoke API key", "parameters": [ { "schema": { "format": "uuid", "type": "string" }, "in": "path", "name": "id", "required": true } ], "security": [ { "bearerAuth": [] } ], "responses": { "204": { "description": "Default Response" }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "404": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/account/email/change/request": { "post": { "operationId": "accountEmailChangeRequest", "summary": "Change email request", "tags": [ "account" ], "description": "Request change of email for authenticated user", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "email", "callbackUrl" ], "properties": { "email": { "format": "email", "type": "string" }, "callbackUrl": { "format": "uri", "type": "string" } } } } } }, "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "409": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "429": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/account/email/change/verify": { "post": { "operationId": "accountEmailChangeVerify", "summary": "Change email verify", "tags": [ "account" ], "description": "Verify change email token (6-digit code) and update user email", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "token" ], "properties": { "token": { "pattern": "^\\d{6}$", "description": "6-digit code", "type": "string" }, "email": { "format": "email", "description": "For code entry (must match request)", "type": "string" }, "verificationId": { "format": "uuid", "description": "For link click", "type": "string" } } } } } }, "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "token", "refreshToken" ], "properties": { "token": { "type": "string" }, "refreshToken": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "429": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/account/link/email/request": { "post": { "operationId": "accountLinkEmailRequest", "summary": "Link email request", "tags": [ "account" ], "description": "Request email to link to authenticated user", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "email", "callbackUrl" ], "properties": { "email": { "format": "email", "type": "string" }, "callbackUrl": { "format": "uri", "type": "string" } } } } } }, "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "409": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/account/link/email/verify": { "post": { "operationId": "accountLinkEmailVerify", "summary": "Link email verify", "tags": [ "account" ], "description": "Verify link email token and update user email", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "token" ], "properties": { "token": { "type": "string" } } } } } }, "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "token", "refreshToken" ], "properties": { "token": { "type": "string" }, "refreshToken": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "409": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/account/link/oauth/{providerId}": { "delete": { "operationId": "accountLinkOauthUnlink", "summary": "OAuth unlink", "tags": [ "account" ], "description": "Unlink OAuth provider from authenticated user", "parameters": [ { "schema": { "anyOf": [ { "type": "string", "enum": [ "github" ] }, { "type": "string", "enum": [ "facebook" ] }, { "type": "string", "enum": [ "twitter" ] }, { "type": "string", "enum": [ "google" ] } ] }, "in": "path", "name": "providerId", "required": true } ], "security": [ { "bearerAuth": [] } ], "responses": { "204": { "description": "Default Response" }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/account/link/passkey/{id}": { "delete": { "operationId": "accountLinkPasskeyDelete", "summary": "Remove passkey", "tags": [ "account" ], "description": "Remove passkey by id", "parameters": [ { "schema": { "format": "uuid", "type": "string" }, "in": "path", "name": "id", "required": true } ], "security": [ { "bearerAuth": [] } ], "responses": { "204": { "description": "Default Response" }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "404": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/account/link/passkey/finish": { "post": { "operationId": "accountLinkPasskeyFinish", "summary": "Passkey registration finish", "tags": [ "account" ], "description": "Finish passkey registration, verify and store credential", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "credential" ], "properties": { "credential": { "type": "object", "required": [ "id", "rawId", "response", "type" ], "properties": { "id": { "type": "string" }, "rawId": { "type": "string" }, "response": { "type": "object", "required": [ "clientDataJSON", "attestationObject" ], "properties": { "clientDataJSON": { "type": "string" }, "attestationObject": { "type": "string" }, "authenticatorData": { "type": "string" }, "transports": { "maxItems": 7, "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "ble" ] }, { "type": "string", "enum": [ "cable" ] }, { "type": "string", "enum": [ "hybrid" ] }, { "type": "string", "enum": [ "internal" ] }, { "type": "string", "enum": [ "nfc" ] }, { "type": "string", "enum": [ "smart-card" ] }, { "type": "string", "enum": [ "usb" ] } ] } }, "publicKeyAlgorithm": { "type": "number" }, "publicKey": { "type": "string" } } }, "authenticatorAttachment": { "anyOf": [ { "type": "string", "enum": [ "platform" ] }, { "type": "string", "enum": [ "cross-platform" ] } ] }, "clientExtensionResults": {}, "type": { "type": "string", "enum": [ "public-key" ] } } }, "name": { "maxLength": 64, "type": "string" } } } } } }, "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "ok" ], "properties": { "ok": { "type": "boolean", "enum": [ true ] } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/account/link/passkey/start": { "post": { "operationId": "accountLinkPasskeyStart", "summary": "Passkey registration start", "tags": [ "account" ], "description": "Start passkey registration, returns options for startRegistration", "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "options" ], "properties": { "options": { "type": "object", "required": [ "rp", "user", "challenge", "pubKeyCredParams" ], "properties": { "rp": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" }, "id": { "type": "string" } } }, "user": { "type": "object", "required": [ "id", "name", "displayName" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "displayName": { "type": "string" } } }, "challenge": { "type": "string" }, "pubKeyCredParams": { "type": "array", "items": { "type": "object", "required": [ "alg", "type" ], "properties": { "alg": { "type": "number" }, "type": { "type": "string", "enum": [ "public-key" ] } } } }, "timeout": { "type": "number" }, "excludeCredentials": { "type": "array", "items": { "type": "object", "required": [ "id", "type" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "public-key" ] }, "transports": { "maxItems": 7, "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "ble" ] }, { "type": "string", "enum": [ "cable" ] }, { "type": "string", "enum": [ "hybrid" ] }, { "type": "string", "enum": [ "internal" ] }, { "type": "string", "enum": [ "nfc" ] }, { "type": "string", "enum": [ "smart-card" ] }, { "type": "string", "enum": [ "usb" ] } ] } } } } }, "authenticatorSelection": { "type": "object", "properties": { "authenticatorAttachment": { "anyOf": [ { "type": "string", "enum": [ "platform" ] }, { "type": "string", "enum": [ "cross-platform" ] } ] }, "requireResidentKey": { "type": "boolean" }, "residentKey": { "anyOf": [ { "type": "string", "enum": [ "discouraged" ] }, { "type": "string", "enum": [ "preferred" ] }, { "type": "string", "enum": [ "required" ] } ] }, "userVerification": { "anyOf": [ { "type": "string", "enum": [ "discouraged" ] }, { "type": "string", "enum": [ "preferred" ] }, { "type": "string", "enum": [ "required" ] } ] } } }, "attestation": { "anyOf": [ { "type": "string", "enum": [ "direct" ] }, { "type": "string", "enum": [ "enterprise" ] }, { "type": "string", "enum": [ "indirect" ] }, { "type": "string", "enum": [ "none" ] } ] }, "extensions": {} } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/account/link/totp/setup": { "post": { "operationId": "accountLinkTotpSetup", "summary": "TOTP setup", "tags": [ "account" ], "description": "Start TOTP setup, returns QR and manual key", "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "otpauthUri", "manualEntryKey", "qrCodeDataUrl" ], "properties": { "otpauthUri": { "type": "string" }, "manualEntryKey": { "type": "string" }, "qrCodeDataUrl": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/account/link/totp/": { "delete": { "operationId": "accountLinkTotpUnlink", "summary": "TOTP unlink", "tags": [ "account" ], "description": "Remove TOTP authenticator", "security": [ { "bearerAuth": [] } ], "responses": { "204": { "description": "Default Response" }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "404": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/account/link/totp/verify": { "post": { "operationId": "accountLinkTotpVerify", "summary": "TOTP verify", "tags": [ "account" ], "description": "Verify TOTP code and persist authenticator", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "code" ], "properties": { "code": { "minLength": 6, "maxLength": 6, "pattern": "^[0-9]{6}$", "type": "string" } } } } } }, "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "ok" ], "properties": { "ok": { "type": "boolean", "enum": [ true ] } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/account/link/wallet/{id}": { "delete": { "operationId": "accountLinkWalletUnlink", "summary": "Unlink wallet", "tags": [ "account" ], "description": "Unlink wallet from authenticated user", "parameters": [ { "schema": { "format": "uuid", "type": "string" }, "in": "path", "name": "id", "required": true } ], "security": [ { "bearerAuth": [] } ], "responses": { "204": { "description": "Default Response" }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "404": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/account/link/wallet/verify": { "post": { "operationId": "accountLinkWalletVerify", "summary": "Link wallet", "tags": [ "account" ], "description": "Link wallet to authenticated user", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "chain", "message", "signature" ], "properties": { "chain": { "anyOf": [ { "type": "string", "enum": [ "eip155" ] }, { "type": "string", "enum": [ "solana" ] } ] }, "message": { "type": "string" }, "signature": { "type": "string" } } } } } }, "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "409": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/account/passkeys/": { "get": { "operationId": "accountPasskeysList", "summary": "List passkeys", "tags": [ "account" ], "description": "List passkeys for authenticated user", "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "passkeys" ], "properties": { "passkeys": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "createdAt" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "createdAt": { "format": "date-time", "type": "string" } } } } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/account/profile/": { "patch": { "operationId": "accountProfileUpdate", "summary": "Update profile", "tags": [ "account" ], "description": "Update profile (name, username)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "minLength": 1, "maxLength": 32, "type": "string" }, "username": { "anyOf": [ { "minLength": 1, "maxLength": 48, "pattern": "^[a-zA-Z0-9_-]{1,48}$", "type": "string" }, { "type": "null" } ] } } } } } }, "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "user" ], "properties": { "user": { "type": "object", "required": [ "id", "email", "name", "username" ], "properties": { "id": { "type": "string" }, "email": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "username": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "409": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/ai/chat": { "post": { "operationId": "chat", "summary": "Generate AI chat response", "tags": [ "ai" ], "description": "Chat with AI via Anthropic, Open Router, or Ollama. Set ANTHROPIC_API_KEY, OPEN_ROUTER_API_KEY, or OLLAMA_BASE_URL. Default model configurable via AI_DEFAULT_MODEL. Supports streaming and tools.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "messages" ], "properties": { "messages": { "minItems": 1, "maxItems": 50, "type": "array", "items": { "anyOf": [ { "type": "object", "required": [ "role", "content" ], "properties": { "role": { "type": "string" }, "content": { "type": "string" }, "name": { "type": "string" } } }, { "type": "object", "required": [ "role", "parts" ], "properties": { "role": { "type": "string" }, "parts": { "type": "array", "items": {} } } } ] } }, "stream": { "type": "boolean" }, "model": { "type": "string" }, "temperature": { "minimum": 0, "maximum": 2, "type": "number" }, "tools": {} } } } } }, "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Chat response (JSON) or streaming (SSE)", "content": { "application/json": { "schema": { "type": "object", "required": [ "text" ], "properties": { "text": { "type": "string" } } } }, "text/event-stream": { "schema": { "description": "Streaming SSE response", "type": "string" } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "402": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "502": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/ai/generate": { "post": { "operationId": "generate", "summary": "Generate text from prompt", "tags": [ "ai" ], "description": "Generate text from a single prompt (CLI, scripts, pipelines). Uses Anthropic, Open Router, or Ollama. Returns SSE (text/event-stream) when streaming.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "minLength": 1, "maxLength": 32000, "type": "string" }, "stream": { "type": "boolean" }, "model": { "default": "default", "type": "string" }, "temperature": { "minimum": 0, "maximum": 2, "type": "number" } } } } } }, "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "text" ], "properties": { "text": { "type": "string" } } }, { "description": "Streaming SSE (text/event-stream) with JSON event objects", "type": "string" } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "402": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "502": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/magiclink/request": { "post": { "operationId": "magiclinkRequest", "summary": "Request magic link", "tags": [ "auth" ], "description": "Request magic link for authentication", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "email", "callbackUrl" ], "properties": { "email": { "format": "email", "type": "string" }, "callbackUrl": { "format": "uri", "type": "string" } } } } } }, "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/magiclink/verify": { "post": { "operationId": "magiclinkVerify", "summary": "Verify magic link", "tags": [ "auth" ], "description": "Verify magic link token and return JWTs", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "token" ], "properties": { "token": { "pattern": "^\\d{6}$", "description": "6-digit code", "type": "string" }, "verificationId": { "format": "uuid", "description": "Verification row id (from magic link URL)", "type": "string" }, "email": { "format": "email", "description": "Email (for code entry on login page)", "type": "string" } } } } } }, "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "token", "refreshToken" ], "properties": { "token": { "type": "string" }, "refreshToken": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "404": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "429": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/oauth/providers": { "get": { "operationId": "oauthProviders", "summary": "OAuth providers availability", "tags": [ "auth" ], "description": "Return which OAuth providers are configured", "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "github", "githubHasRedirectConfig", "google", "googleHasRedirectConfig", "facebook", "facebookHasRedirectConfig", "twitter", "twitterHasRedirectConfig" ], "properties": { "github": { "type": "boolean" }, "githubHasRedirectConfig": { "type": "boolean" }, "google": { "type": "boolean" }, "googleHasRedirectConfig": { "type": "boolean" }, "facebook": { "type": "boolean" }, "facebookHasRedirectConfig": { "type": "boolean" }, "twitter": { "type": "boolean" }, "twitterHasRedirectConfig": { "type": "boolean" } } } } } } } } }, "/auth/oauth/facebook/authorize-url": { "get": { "operationId": "oauthFacebookAuthorizeUrl", "summary": "Facebook OAuth authorize URL", "tags": [ "auth" ], "description": "Return Facebook OAuth authorization URL for client-side redirect", "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "redirect_uri", "required": false } ], "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "redirectUrl" ], "properties": { "redirectUrl": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "503": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/oauth/facebook/exchange": { "post": { "operationId": "oauthFacebookExchange", "summary": "Facebook OAuth exchange", "tags": [ "auth" ], "description": "Exchange Facebook OAuth code for JWTs", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "state" ], "properties": { "code": { "type": "string" }, "state": { "type": "string" } } } } } }, "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "token", "refreshToken" ], "properties": { "token": { "type": "string" }, "refreshToken": { "type": "string" }, "redirectTo": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "409": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "503": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "504": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/oauth/facebook/link-authorize-url": { "get": { "operationId": "oauthFacebookLinkAuthorizeUrl", "summary": "Facebook OAuth link authorize URL", "tags": [ "auth" ], "description": "Return Facebook OAuth URL for linking account (Bearer required)", "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "redirect_uri", "required": false } ], "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "redirectUrl" ], "properties": { "redirectUrl": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "429": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "503": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/oauth/github/authorize-url": { "get": { "operationId": "oauthGithubAuthorizeUrl", "summary": "GitHub OAuth authorize URL", "tags": [ "auth" ], "description": "Return GitHub OAuth authorization URL for client-side redirect", "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "redirect_uri", "required": false } ], "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "redirectUrl" ], "properties": { "redirectUrl": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "503": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/oauth/github/authorize": { "get": { "operationId": "oauthGithubAuthorize", "summary": "GitHub OAuth authorize", "tags": [ "auth" ], "description": "Redirect to GitHub OAuth authorization", "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "redirect_uri", "required": false } ], "security": [], "responses": { "302": { "description": "Redirect to GitHub", "content": { "application/json": { "schema": { "type": "string", "description": "Redirect to GitHub" } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "503": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/oauth/github/exchange": { "post": { "operationId": "oauthGithubExchange", "summary": "GitHub OAuth exchange", "tags": [ "auth" ], "description": "Exchange GitHub OAuth code for JWTs", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "state" ], "properties": { "code": { "type": "string" }, "state": { "type": "string" } } } } } }, "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "token", "refreshToken" ], "properties": { "token": { "type": "string" }, "refreshToken": { "type": "string" }, "redirectTo": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "409": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "503": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/oauth/github/link-authorize-url": { "get": { "operationId": "oauthGithubLinkAuthorizeUrl", "summary": "GitHub OAuth link authorize URL", "tags": [ "auth" ], "description": "Return GitHub OAuth URL for linking account (Bearer required)", "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "redirect_uri", "required": false } ], "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "redirectUrl" ], "properties": { "redirectUrl": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "429": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "503": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/oauth/google/authorize-url": { "get": { "operationId": "oauthGoogleAuthorizeUrl", "summary": "Google OAuth authorize URL", "tags": [ "auth" ], "description": "Return Google OAuth authorization URL for client-side redirect", "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "redirect_uri", "required": false } ], "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "redirectUrl" ], "properties": { "redirectUrl": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "503": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/oauth/google/exchange": { "post": { "operationId": "oauthGoogleExchange", "summary": "Google OAuth exchange", "tags": [ "auth" ], "description": "Exchange Google OAuth code for JWTs", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "state" ], "properties": { "code": { "type": "string" }, "state": { "type": "string" } } } } } }, "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "token", "refreshToken" ], "properties": { "token": { "type": "string" }, "refreshToken": { "type": "string" }, "redirectTo": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "409": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "429": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "503": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "504": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/oauth/google/link-authorize-url": { "get": { "operationId": "oauthGoogleLinkAuthorizeUrl", "summary": "Google OAuth link authorize URL", "tags": [ "auth" ], "description": "Return Google OAuth URL for linking account (Bearer required)", "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "redirect_uri", "required": false } ], "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "redirectUrl" ], "properties": { "redirectUrl": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "429": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "503": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/oauth/google/verify-id-token": { "post": { "operationId": "oauthGoogleVerifyIdToken", "summary": "Google OAuth verify ID token", "tags": [ "auth" ], "description": "Verify Google One Tap ID token and issue JWTs", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "credential" ], "properties": { "credential": { "type": "string" } } } } } }, "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "token", "refreshToken" ], "properties": { "token": { "type": "string" }, "refreshToken": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "503": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/oauth/twitter/authorize-url": { "get": { "operationId": "oauthTwitterAuthorizeUrl", "summary": "Twitter OAuth authorize URL", "tags": [ "auth" ], "description": "Return Twitter/X OAuth authorization URL for client-side redirect (PKCE)", "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "redirect_uri", "required": false } ], "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "redirectUrl" ], "properties": { "redirectUrl": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "503": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/oauth/twitter/exchange": { "post": { "operationId": "oauthTwitterExchange", "summary": "Twitter OAuth exchange", "tags": [ "auth" ], "description": "Exchange Twitter/X OAuth code for JWTs (PKCE)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "state" ], "properties": { "code": { "type": "string" }, "state": { "type": "string" } } } } } }, "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "token", "refreshToken" ], "properties": { "token": { "type": "string" }, "refreshToken": { "type": "string" }, "redirectTo": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "409": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "502": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "503": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "504": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/oauth/twitter/link-authorize-url": { "get": { "operationId": "oauthTwitterLinkAuthorizeUrl", "summary": "Twitter OAuth link authorize URL", "tags": [ "auth" ], "description": "Return Twitter/X OAuth URL for linking account (Bearer required, PKCE)", "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "redirect_uri", "required": false } ], "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "redirectUrl" ], "properties": { "redirectUrl": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "429": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "503": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/passkey/exchange": { "post": { "operationId": "authPasskeyExchange", "summary": "Exchange passkey code for tokens", "tags": [ "auth" ], "description": "Exchange one-time code for tokens (passkey redirect flow)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string" } } } } } }, "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "token", "refreshToken" ], "properties": { "token": { "type": "string" }, "refreshToken": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/passkey/resolve-user": { "post": { "operationId": "authPasskeyResolveUser", "summary": "Passkey resolve user", "tags": [ "auth" ], "description": "Resolve user email from passkey assertion userHandle (for discovery UX)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "userHandle" ], "properties": { "userHandle": { "pattern": "^[A-Za-z0-9_-]+(={0,2})?$", "minLength": 1, "type": "string" } } } } } }, "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "maskedIdentifier" ], "properties": { "maskedIdentifier": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "429": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "message", "retryAfter" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "retryAfter": { "type": "integer" } } } } } } } } }, "/auth/passkey/start": { "post": { "operationId": "authPasskeyStart", "summary": "Passkey auth start", "tags": [ "auth" ], "description": "Start passkey authentication, returns options for startAuthentication", "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "options", "sessionId" ], "properties": { "options": { "type": "object", "required": [ "challenge" ], "properties": { "challenge": { "type": "string" }, "timeout": { "type": "number" }, "rpId": { "type": "string" }, "allowCredentials": { "type": "array", "items": { "type": "object", "required": [ "id", "type" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "public-key" ] }, "transports": { "maxItems": 7, "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "ble" ] }, { "type": "string", "enum": [ "cable" ] }, { "type": "string", "enum": [ "hybrid" ] }, { "type": "string", "enum": [ "internal" ] }, { "type": "string", "enum": [ "nfc" ] }, { "type": "string", "enum": [ "smart-card" ] }, { "type": "string", "enum": [ "usb" ] } ] } } } } }, "userVerification": { "anyOf": [ { "type": "string", "enum": [ "discouraged" ] }, { "type": "string", "enum": [ "preferred" ] }, { "type": "string", "enum": [ "required" ] } ] }, "extensions": {} } }, "sessionId": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/passkey/verify": { "post": { "operationId": "authPasskeyVerify", "summary": "Passkey auth verify", "tags": [ "auth" ], "description": "Verify passkey assertion and create session", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "assertion", "sessionId" ], "properties": { "assertion": { "type": "object", "required": [ "id", "rawId", "response", "type" ], "properties": { "id": { "type": "string" }, "rawId": { "type": "string" }, "response": { "type": "object", "required": [ "clientDataJSON", "authenticatorData", "signature" ], "properties": { "clientDataJSON": { "type": "string" }, "authenticatorData": { "type": "string" }, "signature": { "type": "string" }, "userHandle": { "type": "string" } } }, "authenticatorAttachment": { "anyOf": [ { "type": "string", "enum": [ "platform" ] }, { "type": "string", "enum": [ "cross-platform" ] } ] }, "clientExtensionResults": {}, "type": { "type": "string", "enum": [ "public-key" ] } } }, "sessionId": { "type": "string" }, "callbackUrl": { "type": "string" } } } } } }, "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "redirectUrl" ], "properties": { "redirectUrl": { "type": "string" } } }, { "type": "object", "required": [ "token", "refreshToken" ], "properties": { "token": { "type": "string" }, "refreshToken": { "type": "string" } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/session/logout": { "post": { "operationId": "logout", "summary": "Logout", "tags": [ "auth" ], "description": "Logout user and invalidate session", "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" } } } } } }, "204": { "description": "Default Response" }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/session/refresh": { "post": { "operationId": "refresh", "summary": "Refresh token", "tags": [ "auth" ], "description": "Refresh access token", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "refreshToken" ], "properties": { "refreshToken": { "type": "string" } } } } } }, "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "token", "refreshToken" ], "properties": { "token": { "type": "string" }, "refreshToken": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/session/user": { "get": { "operationId": "getUser", "summary": "Get user", "tags": [ "auth" ], "description": "Get current user information", "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "user" ], "properties": { "user": { "type": "object", "required": [ "id", "email", "name", "username", "emailVerified", "linkedWallets", "linkedAccounts", "totpEnabled", "passkeys" ], "properties": { "id": { "type": "string" }, "email": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "username": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "emailVerified": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] }, "wallet": { "type": "object", "required": [ "chain", "address" ], "properties": { "chain": { "type": "string" }, "address": { "type": "string" } } }, "linkedWallets": { "type": "array", "items": { "type": "object", "required": [ "id", "chain", "address" ], "properties": { "id": { "type": "string" }, "chain": { "type": "string" }, "address": { "type": "string" } } } }, "linkedAccounts": { "type": "array", "items": { "type": "object", "required": [ "providerId" ], "properties": { "providerId": { "type": "string" } } } }, "totpEnabled": { "type": "boolean" }, "passkeys": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "createdAt" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "createdAt": { "format": "date-time", "type": "string" } } } } } } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/web3/exchange": { "post": { "operationId": "web3Exchange", "summary": "Exchange code for tokens", "tags": [ "auth" ], "description": "Exchange one-time code for tokens (redirect flow)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string" } } } } } }, "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "token", "refreshToken" ], "properties": { "token": { "type": "string" }, "refreshToken": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/web3/nonce": { "get": { "operationId": "web3Nonce", "summary": "Get nonce", "tags": [ "auth" ], "description": "Get nonce for wallet sign-in or account linking", "parameters": [ { "schema": { "anyOf": [ { "type": "string", "enum": [ "eip155" ] }, { "type": "string", "enum": [ "solana" ] } ] }, "in": "query", "name": "chain", "required": true }, { "schema": { "type": "string" }, "in": "query", "name": "address", "required": true } ], "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "nonce" ], "properties": { "nonce": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/web3/eip155/nonce": { "get": { "operationId": "web3Eip155Nonce", "summary": "Get EIP-155 nonce", "tags": [ "auth" ], "description": "Get nonce for SIWE (Sign-In with Ethereum)", "parameters": [ { "schema": { "minLength": 1, "type": "string" }, "in": "query", "name": "address", "required": true } ], "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "nonce" ], "properties": { "nonce": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/web3/eip155/verify": { "post": { "operationId": "web3Eip155Verify", "summary": "Verify EIP-155 signature", "tags": [ "auth" ], "description": "Verify SIWE signature and return JWTs", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "message", "signature" ], "properties": { "message": { "type": "string" }, "signature": { "type": "string" }, "domain": { "type": "string" }, "callbackUrl": { "type": "string" } } } } } }, "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "token", "refreshToken" ], "properties": { "token": { "type": "string" }, "refreshToken": { "type": "string" } } } } } }, "302": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "properties": { "description": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/web3/solana/nonce": { "get": { "operationId": "web3SolanaNonce", "summary": "Get Solana nonce", "tags": [ "auth" ], "description": "Get nonce for SIWS (Sign-In with Solana)", "parameters": [ { "schema": { "minLength": 1, "type": "string" }, "in": "query", "name": "address", "required": true } ], "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "nonce" ], "properties": { "nonce": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/auth/web3/solana/verify": { "post": { "operationId": "web3SolanaVerify", "summary": "Verify Solana signature", "tags": [ "auth" ], "description": "Verify SIWS signature and return JWTs", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "message", "signature" ], "properties": { "message": { "type": "string" }, "signature": { "type": "string" }, "domain": { "type": "string" }, "callbackUrl": { "type": "string" } } } } } }, "security": [], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "token", "refreshToken" ], "properties": { "token": { "type": "string" }, "refreshToken": { "type": "string" } } } } } }, "302": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "properties": { "description": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "401": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } } }, "security": [ { "bearerAuth": [] }, { "apiKeyAuth": [] } ] }