auth
由 openapi.json 自动生成的 34 个端点及其请求、响应和权限元数据。
此参考由已发布 API 契约生成。字段、请求头和权限要求如下。
下载完整 OpenAPI 文档 · SHA-256: ccaa20cec11fad96e369b88073ce3608a5b071ce55d6dc03fa31df7b0f08c525
标识符和数据结构与公开契约一致,说明直接给出调用规则。共享模型见 数据模型.
GET /api/v1/auth/callback/{id}
GET /api/v1/auth/callback/{id}
OAuth authorization-code callback
{
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "OAuth authorization-code callback",
"tags": [
"auth"
],
"x-body": "none",
"x-body-limit": 0,
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}changePassword
POST /api/v1/auth/change-password
Change the password (revokes the other sessions)
Change the password of the user
{
"description": "Change the password of the user",
"operationId": "changePassword",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"currentPassword": {
"description": "The current password is required",
"type": "string"
},
"newPassword": {
"description": "The new password to set",
"type": "string"
},
"revokeOtherSessions": {
"description": "Must be a boolean value",
"type": "boolean"
}
},
"required": [
"newPassword",
"currentPassword"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"token": {
"description": "New session token if other sessions were revoked",
"nullable": true,
"type": "string"
},
"user": {
"properties": {
"createdAt": {
"description": "When the user was created",
"format": "date-time",
"type": "string"
},
"email": {
"description": "The email address of the user",
"format": "email",
"type": "string"
},
"emailVerified": {
"description": "Whether the email has been verified",
"type": "boolean"
},
"id": {
"description": "The unique identifier of the user",
"type": "string"
},
"image": {
"description": "The profile image URL of the user",
"format": "uri",
"nullable": true,
"type": "string"
},
"name": {
"description": "The name of the user",
"type": "string"
},
"updatedAt": {
"description": "When the user was last updated",
"format": "date-time",
"type": "string"
}
},
"required": [
"id",
"email",
"name",
"emailVerified",
"createdAt",
"updatedAt"
],
"type": "object"
}
},
"required": [
"user"
],
"type": "object"
}
}
},
"description": "Password successfully changed"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Change the password (revokes the other sessions)",
"tags": [
"auth"
],
"x-audit": "auth.password.change",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}GET /api/v1/auth/device
GET /api/v1/auth/device
Review and claim device user code
Verify user code and get device authorization status
{
"description": "Verify user code and get device authorization status",
"parameters": [
{
"in": "query",
"name": "user_code",
"schema": {
"description": "The user code to verify",
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"client_id": {
"description": "The client requesting authorization, returned only to the authenticated user who owns this request",
"type": "string"
},
"scope": {
"description": "The requested scopes, returned only to the authenticated user who owns this request",
"type": "string"
},
"status": {
"description": "Current status of the device authorization",
"enum": [
"pending",
"approved",
"denied"
],
"type": "string"
},
"user_code": {
"description": "The user code to verify",
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Device authorization status"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Review and claim device user code",
"tags": [
"auth"
],
"x-body": "none",
"x-body-limit": 0,
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}POST /api/v1/auth/device/approve
POST /api/v1/auth/device/approve
Approve device authorization
Approve device authorization
{
"description": "Approve device authorization",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"userCode": {
"description": "The user code to approve",
"type": "string"
}
},
"required": [
"userCode"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"success": {
"type": "boolean"
}
},
"type": "object"
}
}
},
"description": "Success"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Approve device authorization",
"tags": [
"auth"
],
"x-audit": "auth.device.approve",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.mfa.ip",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}POST /api/v1/auth/device/code
POST /api/v1/auth/device/code
Request device authorization
Request a device and user code
Follow rfc8628#section-3.2
{
"description": "Request a device and user code\n\nFollow [rfc8628#section-3.2](https://datatracker.ietf.org/doc/html/rfc8628#section-3.2)",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"client_id": {
"description": "The client ID of the application",
"type": "string"
},
"scope": {
"description": "Space-separated list of scopes",
"type": "string"
},
"user_id": {
"description": "The user ID to which the device code should be pre-bound.",
"type": "string"
}
},
"required": [
"client_id"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"device_code": {
"description": "The device verification code",
"type": "string"
},
"expires_in": {
"description": "Lifetime in seconds of the device code",
"type": "number"
},
"interval": {
"description": "Minimum polling interval in seconds",
"type": "number"
},
"user_code": {
"description": "The user code to display",
"type": "string"
},
"verification_uri": {
"description": "The URL for user verification. Defaults to /device if not configured.",
"format": "uri",
"type": "string"
},
"verification_uri_complete": {
"description": "The complete URL with user code as query parameter.",
"format": "uri",
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Success"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"error": {
"enum": [
"invalid_request",
"invalid_client",
"unauthorized_client",
"invalid_scope"
],
"type": "string"
},
"error_description": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Error response"
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"error": {
"enum": [
"server_error"
],
"type": "string"
},
"error_description": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Server error"
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Request device authorization",
"tags": [
"auth"
],
"x-audit": "auth.device.code",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.code.ip",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}POST /api/v1/auth/device/deny
POST /api/v1/auth/device/deny
Deny device authorization
Deny device authorization
{
"description": "Deny device authorization",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"userCode": {
"description": "The user code to deny",
"type": "string"
}
},
"required": [
"userCode"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"success": {
"type": "boolean"
}
},
"type": "object"
}
}
},
"description": "Success"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Deny device authorization",
"tags": [
"auth"
],
"x-audit": "auth.device.deny",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.mfa.ip",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}POST /api/v1/auth/device/token
POST /api/v1/auth/device/token
Poll device authorization
Exchange device code for access token
Follow rfc8628#section-3.4
{
"description": "Exchange device code for access token\n\nFollow [rfc8628#section-3.4](https://datatracker.ietf.org/doc/html/rfc8628#section-3.4)",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"client_id": {
"description": "The client ID of the application",
"type": "string"
},
"device_code": {
"description": "The device verification code",
"type": "string"
},
"grant_type": {
"description": "The grant type for device flow",
"enum": [
"urn:ietf:params:oauth:grant-type:device_code"
]
}
},
"required": [
"grant_type",
"device_code",
"client_id"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"access_token": {
"type": "string"
},
"expires_in": {
"type": "integer"
},
"scope": {
"type": "string"
},
"token_type": {
"enum": [
"Bearer"
],
"type": "string"
}
},
"required": [
"access_token",
"token_type",
"expires_in",
"scope"
],
"type": "object"
}
}
},
"description": "Signed bearer session token"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"error": {
"enum": [
"authorization_pending",
"slow_down",
"expired_token",
"access_denied",
"invalid_request",
"invalid_grant"
],
"type": "string"
},
"error_description": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Error response"
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Poll device authorization",
"tags": [
"auth"
],
"x-audit": "auth.device.token",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.code.ip",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}resetPasswordWithEmailOTP
POST /api/v1/auth/email-otp/reset-password
Reset the password with a code (revokes every session)
Reset password with email and OTP
{
"description": "Reset password with email and OTP",
"operationId": "resetPasswordWithEmailOTP",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"email": {
"description": "Email address to reset the password",
"type": "string"
},
"otp": {
"description": "OTP sent to the email",
"type": "string"
},
"password": {
"description": "New password",
"type": "string"
}
},
"required": [
"email",
"otp",
"password"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"success": {
"type": "boolean"
}
},
"type": "object"
}
}
},
"description": "Success"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Reset the password with a code (revokes every session)",
"tags": [
"auth"
],
"x-audit": "auth.password.reset",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.code.ip",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}sendEmailVerificationOTP
POST /api/v1/auth/email-otp/send-verification-otp
Send an email verification code
Send a verification OTP to an email
{
"description": "Send a verification OTP to an email",
"operationId": "sendEmailVerificationOTP",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"email": {
"description": "Email address to send the OTP",
"type": "string"
},
"type": {
"description": "Type of the OTP",
"enum": [
"email-verification",
"sign-in",
"forget-password",
"change-email"
],
"type": "string"
}
},
"required": [
"email",
"type"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"success": {
"type": "boolean"
}
},
"type": "object"
}
}
},
"description": "Success"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Send an email verification code",
"tags": [
"auth"
],
"x-audit": "auth.code.send",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.code.target",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}POST /api/v1/auth/email-otp/verify-email
POST /api/v1/auth/email-otp/verify-email
Verify the email with a code (signs in)
Verify email with OTP
{
"description": "Verify email with OTP",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"email": {
"description": "Email address to verify",
"type": "string"
},
"otp": {
"description": "OTP to verify",
"type": "string"
}
},
"required": [
"email",
"otp"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"status": {
"description": "Indicates if the verification was successful",
"enum": [
true
],
"type": "boolean"
},
"token": {
"description": "Session token if autoSignInAfterVerification is enabled, otherwise null",
"nullable": true,
"type": "string"
},
"user": {
"properties": {
"createdAt": {
"format": "date-time",
"type": "string"
},
"email": {
"type": "string"
},
"emailVerified": {
"default": false,
"readOnly": true,
"type": "boolean"
},
"id": {
"readOnly": true,
"type": "string"
},
"image": {
"type": "string"
},
"inviteCodeId": {
"readOnly": true,
"type": "string"
},
"invitedByUserId": {
"readOnly": true,
"type": "string"
},
"invitedVia": {
"readOnly": true,
"type": "string"
},
"locale": {
"type": "string"
},
"name": {
"type": "string"
},
"phoneNumber": {
"type": "string"
},
"phoneNumberVerified": {
"readOnly": true,
"type": "boolean"
},
"publicId": {
"readOnly": true,
"type": "string"
},
"registeredVia": {
"readOnly": true,
"type": "string"
},
"status": {
"readOnly": true,
"type": "string"
},
"timeZone": {
"readOnly": true,
"type": "string"
},
"twoFactorEnabled": {
"default": false,
"readOnly": true,
"type": "boolean"
},
"updatedAt": {
"format": "date-time",
"type": "string"
}
},
"required": [
"id",
"name",
"email",
"emailVerified",
"createdAt",
"updatedAt"
],
"type": "object"
}
},
"required": [
"status",
"token",
"user"
],
"type": "object"
}
}
},
"description": "Success"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Verify the email with a code (signs in)",
"tags": [
"auth"
],
"x-audit": "auth.email.verify",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.code.ip",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}getSession
GET /api/v1/auth/get-session
Current session
Get the current session
{
"description": "Get the current session",
"operationId": "getSession",
"parameters": [],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"session": {
"properties": {
"absoluteExpiresAt": {
"format": "date-time",
"readOnly": true,
"type": "string"
},
"activeOrganizationId": {
"readOnly": true,
"type": "string"
},
"clientKind": {
"readOnly": true,
"type": "string"
},
"createdAt": {
"format": "date-time",
"type": "string"
},
"expiresAt": {
"format": "date-time",
"type": "string"
},
"id": {
"readOnly": true,
"type": "string"
},
"ipAddress": {
"type": "string"
},
"mfaVerifiedAt": {
"format": "date-time",
"readOnly": true,
"type": "string"
},
"reauthAt": {
"format": "date-time",
"readOnly": true,
"type": "string"
},
"token": {
"type": "string"
},
"updatedAt": {
"format": "date-time",
"type": "string"
},
"userAgent": {
"type": "string"
},
"userId": {
"type": "string"
}
},
"required": [
"id",
"expiresAt",
"token",
"createdAt",
"updatedAt",
"userId"
],
"type": "object"
},
"user": {
"properties": {
"createdAt": {
"format": "date-time",
"type": "string"
},
"email": {
"type": "string"
},
"emailVerified": {
"default": false,
"readOnly": true,
"type": "boolean"
},
"id": {
"readOnly": true,
"type": "string"
},
"image": {
"type": "string"
},
"inviteCodeId": {
"readOnly": true,
"type": "string"
},
"invitedByUserId": {
"readOnly": true,
"type": "string"
},
"invitedVia": {
"readOnly": true,
"type": "string"
},
"locale": {
"type": "string"
},
"name": {
"type": "string"
},
"phoneNumber": {
"type": "string"
},
"phoneNumberVerified": {
"readOnly": true,
"type": "boolean"
},
"publicId": {
"readOnly": true,
"type": "string"
},
"registeredVia": {
"readOnly": true,
"type": "string"
},
"status": {
"readOnly": true,
"type": "string"
},
"timeZone": {
"readOnly": true,
"type": "string"
},
"twoFactorEnabled": {
"default": false,
"readOnly": true,
"type": "boolean"
},
"updatedAt": {
"format": "date-time",
"type": "string"
}
},
"required": [
"id",
"name",
"email",
"emailVerified",
"createdAt",
"updatedAt"
],
"type": "object"
}
},
"required": [
"session",
"user"
],
"type": [
"object",
"null"
]
}
}
},
"description": "Success"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Current session",
"tags": [
"auth"
],
"x-body": "none",
"x-body-limit": 0,
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}linkSocialAccount
POST /api/v1/auth/link-social
Link a provider after reauthentication
Link a social account to the user
{
"description": "Link a social account to the user",
"operationId": "linkSocialAccount",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"additionalData": {
"additionalProperties": {},
"propertyNames": {
"type": "string"
},
"type": "object"
},
"additionalParams": {
"additionalProperties": {
"type": "string"
},
"description": "Extra query parameters to append to the provider authorization URL (e.g. Cognito identity_provider, Google hd).",
"propertyNames": {
"type": "string"
},
"type": "object"
},
"callbackURL": {
"description": "The URL to redirect to after the user has signed in",
"type": "string"
},
"disableRedirect": {
"description": "Disable automatic redirection to the provider. Useful for handling the redirection yourself",
"type": "boolean"
},
"errorCallbackURL": {
"description": "The URL to redirect to if there is an error during the link process",
"type": "string"
},
"idToken": {
"properties": {
"accessToken": {
"type": "string"
},
"nonce": {
"type": "string"
},
"refreshToken": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"token"
],
"type": "object"
},
"loginHint": {
"description": "The login hint to use for the authorization code request",
"type": "string"
},
"provider": {
"anyOf": [
{
"enum": [
"apple",
"atlassian",
"cloudflare",
"cognito",
"discord",
"facebook",
"figma",
"github",
"microsoft",
"google",
"huggingface",
"slack",
"spotify",
"twitch",
"twitter",
"dropbox",
"kick",
"linear",
"linkedin",
"gitlab",
"tiktok",
"reddit",
"roblox",
"salesforce",
"vk",
"zoom",
"notion",
"kakao",
"naver",
"line",
"paybin",
"paypal",
"polar",
"railway",
"vercel",
"wechat"
],
"type": "string"
},
{
"type": "string"
}
]
},
"requestSignUp": {
"type": "boolean"
},
"scopes": {
"description": "Additional scopes to request from the provider",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"provider"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"redirect": {
"description": "Indicates if the user should be redirected to the authorization URL",
"type": "boolean"
},
"status": {
"type": "boolean"
},
"url": {
"description": "The authorization URL to redirect the user to",
"type": "string"
}
},
"required": [
"redirect"
],
"type": "object"
}
}
},
"description": "Success"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Link a provider after reauthentication",
"tags": [
"auth"
],
"x-audit": "auth.account.link",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.login.account",
"x-reauth": true,
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}GET /api/v1/auth/linked-accounts
GET /api/v1/auth/linked-accounts
Current user sign-in methods
{
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"accounts": {
"items": {
"properties": {
"account_id": {
"type": "string"
},
"created_at": {
"format": "date-time",
"type": "string"
},
"id": {
"type": "string"
},
"provider_id": {
"type": "string"
}
},
"required": [
"id",
"provider_id",
"account_id",
"created_at"
],
"type": "object"
},
"type": "array"
},
"email_sign_in": {
"type": "boolean"
},
"phone_number": {
"type": [
"string",
"null"
]
},
"phone_number_verified": {
"type": "boolean"
}
},
"required": [
"accounts",
"phone_number",
"phone_number_verified",
"email_sign_in"
],
"type": "object"
}
}
},
"description": "Sign-in methods"
}
},
"summary": "Current user sign-in methods",
"tags": [
"auth"
],
"x-body": "none",
"x-body-limit": 0,
"x-reauth": false,
"effectiveSecurity": []
}listUserSessions
GET /api/v1/auth/list-sessions
Sessions of the current user
List all active sessions for the user
{
"description": "List all active sessions for the user",
"operationId": "listUserSessions",
"parameters": [],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"items": {
"properties": {
"absoluteExpiresAt": {
"format": "date-time",
"readOnly": true,
"type": "string"
},
"activeOrganizationId": {
"readOnly": true,
"type": "string"
},
"clientKind": {
"readOnly": true,
"type": "string"
},
"createdAt": {
"format": "date-time",
"type": "string"
},
"expiresAt": {
"format": "date-time",
"type": "string"
},
"id": {
"readOnly": true,
"type": "string"
},
"ipAddress": {
"type": "string"
},
"mfaVerifiedAt": {
"format": "date-time",
"readOnly": true,
"type": "string"
},
"reauthAt": {
"format": "date-time",
"readOnly": true,
"type": "string"
},
"token": {
"type": "string"
},
"updatedAt": {
"format": "date-time",
"type": "string"
},
"userAgent": {
"type": "string"
},
"userId": {
"type": "string"
}
},
"required": [
"id",
"expiresAt",
"token",
"createdAt",
"updatedAt",
"userId"
],
"type": "object"
},
"type": "array"
}
}
},
"description": "Success"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Sessions of the current user",
"tags": [
"auth"
],
"x-body": "none",
"x-body-limit": 0,
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}POST /api/v1/auth/phone-number/remove
POST /api/v1/auth/phone-number/remove
Remove verified phone number
{
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"accountId": {
"format": "uuid",
"type": "string"
}
},
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"status": {
"enum": [
true
],
"type": "boolean"
}
},
"required": [
"status"
],
"type": "object"
}
}
},
"description": "Removed"
}
},
"summary": "Remove verified phone number",
"tags": [
"auth"
],
"x-audit": "auth.phone.remove",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.reauth.session",
"x-reauth": true,
"effectiveSecurity": []
}POST /api/v1/auth/phone-number/send-otp
POST /api/v1/auth/phone-number/send-otp
Send phone verification code
Use this endpoint to send OTP to phone number
{
"description": "Use this endpoint to send OTP to phone number",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"phoneNumber": {
"description": "Phone number to send OTP. Eg: \"+1234567890\"",
"type": "string"
}
},
"required": [
"phoneNumber"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Success"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Send phone verification code",
"tags": [
"auth"
],
"x-audit": "auth.phone.code",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.code.target",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}POST /api/v1/auth/phone-number/verify
POST /api/v1/auth/phone-number/verify
Verify phone, sign in or bind
Use this endpoint to verify phone number
{
"description": "Use this endpoint to verify phone number",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"additionalProperties": {},
"properties": {
"code": {
"description": "OTP code. Eg: \"123456\"",
"type": "string"
},
"disableSession": {
"description": "Disable session creation after verification. Eg: false",
"type": "boolean"
},
"phoneNumber": {
"description": "Phone number to verify. Eg: \"+1234567890\"",
"type": "string"
},
"updatePhoneNumber": {
"description": "Check if there is a session and update the phone number. Eg: true",
"type": "boolean"
}
},
"propertyNames": {
"type": "string"
},
"required": [
"phoneNumber",
"code"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"status": {
"description": "Indicates if the verification was successful",
"enum": [
true
],
"type": "boolean"
},
"token": {
"description": "Session token if session is created, null if disableSession is true or no session is created",
"nullable": true,
"type": "string"
},
"user": {
"description": "User object with phone number details, null if no user is created or found",
"nullable": true,
"properties": {
"createdAt": {
"description": "Timestamp when the user was created",
"format": "date-time",
"type": "string"
},
"email": {
"description": "User's email address",
"format": "email",
"nullable": true,
"type": "string"
},
"emailVerified": {
"description": "Whether the email is verified",
"nullable": true,
"type": "boolean"
},
"id": {
"description": "Unique identifier of the user",
"type": "string"
},
"image": {
"description": "User's profile image URL",
"format": "uri",
"nullable": true,
"type": "string"
},
"name": {
"description": "User's name",
"nullable": true,
"type": "string"
},
"phoneNumber": {
"description": "User's phone number",
"type": "string"
},
"phoneNumberVerified": {
"description": "Whether the phone number is verified",
"type": "boolean"
},
"updatedAt": {
"description": "Timestamp when the user was last updated",
"format": "date-time",
"type": "string"
}
},
"required": [
"id",
"phoneNumber",
"phoneNumberVerified",
"createdAt",
"updatedAt"
],
"type": "object"
}
},
"required": [
"status"
],
"type": "object"
}
}
},
"description": "Phone number verified successfully"
},
"400": {
"description": "Invalid OTP"
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Verify phone, sign in or bind",
"tags": [
"auth"
],
"x-audit": "auth.phone.verify",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.login.account",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}POST /api/v1/auth/reauth
POST /api/v1/auth/reauth
Re-verify with password or authenticator code (sensitive operations, 10-minute window)
{
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ReauthRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ReauthResult"
}
}
},
"description": "Re-verified"
}
},
"summary": "Re-verify with password or authenticator code (sensitive operations, 10-minute window)",
"tags": [
"auth"
],
"x-audit": "auth.reauth",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.reauth.session",
"effectiveSecurity": []
}POST /api/v1/auth/revoke-other-sessions
POST /api/v1/auth/revoke-other-sessions
Revoke all other sessions
Revoke all other sessions for the user except the current one
{
"description": "Revoke all other sessions for the user except the current one",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {},
"type": "object"
}
}
}
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"status": {
"description": "Indicates if all other sessions were revoked successfully",
"type": "boolean"
}
},
"required": [
"status"
],
"type": "object"
}
}
},
"description": "Success"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Revoke all other sessions",
"tags": [
"auth"
],
"x-audit": "auth.session.revoke_others",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}POST /api/v1/auth/revoke-session
POST /api/v1/auth/revoke-session
Revoke one session
Revoke a single session
{
"description": "Revoke a single session",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"token": {
"description": "The token to revoke",
"type": "string"
}
},
"required": [
"token"
],
"type": "object"
}
}
}
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"status": {
"description": "Indicates if the session was revoked successfully",
"type": "boolean"
}
},
"required": [
"status"
],
"type": "object"
}
}
},
"description": "Success"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Revoke one session",
"tags": [
"auth"
],
"x-audit": "auth.session.revoke",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}GET /api/v1/auth/sign-in-options
GET /api/v1/auth/sign-in-options
Enabled public sign-in methods
{
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"device": {
"type": "boolean"
},
"phone": {
"type": "boolean"
},
"providers": {
"items": {
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"id",
"name"
],
"type": "object"
},
"type": "array"
},
"telegram": {
"properties": {
"bot_id": {
"type": [
"string",
"null"
]
},
"username": {
"type": "string"
}
},
"required": [
"username",
"bot_id"
],
"type": [
"object",
"null"
]
}
},
"required": [
"phone",
"providers",
"telegram",
"device"
],
"type": "object"
}
}
},
"description": "Enabled methods without credentials"
}
},
"summary": "Enabled public sign-in methods",
"tags": [
"auth"
],
"x-body": "none",
"x-body-limit": 0,
"effectiveSecurity": []
}signInEmail
POST /api/v1/auth/sign-in/email
Sign in with email and password
Sign in with email and password
{
"description": "Sign in with email and password",
"operationId": "signInEmail",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"callbackURL": {
"description": "Callback URL to use as a redirect for email verification",
"type": "string"
},
"email": {
"description": "Email of the user",
"type": "string"
},
"password": {
"description": "Password of the user",
"type": "string"
},
"rememberMe": {
"description": "If this is false, the session will not be remembered. Default is `true`.",
"type": "boolean"
}
},
"required": [
"email",
"password"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"description": "Session response when idToken is provided",
"properties": {
"redirect": {
"enum": [
false
],
"type": "boolean"
},
"token": {
"description": "Session token",
"type": "string"
},
"url": {
"nullable": true,
"type": "string"
},
"user": {
"properties": {
"createdAt": {
"format": "date-time",
"type": "string"
},
"email": {
"type": "string"
},
"emailVerified": {
"default": false,
"readOnly": true,
"type": "boolean"
},
"id": {
"readOnly": true,
"type": "string"
},
"image": {
"type": "string"
},
"inviteCodeId": {
"readOnly": true,
"type": "string"
},
"invitedByUserId": {
"readOnly": true,
"type": "string"
},
"invitedVia": {
"readOnly": true,
"type": "string"
},
"locale": {
"type": "string"
},
"name": {
"type": "string"
},
"phoneNumber": {
"type": "string"
},
"phoneNumberVerified": {
"readOnly": true,
"type": "boolean"
},
"publicId": {
"readOnly": true,
"type": "string"
},
"registeredVia": {
"readOnly": true,
"type": "string"
},
"status": {
"readOnly": true,
"type": "string"
},
"timeZone": {
"readOnly": true,
"type": "string"
},
"twoFactorEnabled": {
"default": false,
"readOnly": true,
"type": "boolean"
},
"updatedAt": {
"format": "date-time",
"type": "string"
}
},
"required": [
"id",
"name",
"email",
"emailVerified",
"createdAt",
"updatedAt"
],
"type": "object"
}
},
"required": [
"redirect",
"token",
"user"
],
"type": "object"
}
}
},
"description": "Success - Returns either session details or redirect URL"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Sign in with email and password",
"tags": [
"auth"
],
"x-audit": "auth.sign_in",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.login.account",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}signInWithEmailOTP
POST /api/v1/auth/sign-in/email-otp
Sign in with an email code
Sign in with email and OTP
{
"description": "Sign in with email and OTP",
"operationId": "signInWithEmailOTP",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"additionalProperties": {},
"properties": {
"email": {
"description": "Email address to sign in",
"type": "string"
},
"image": {
"description": "User profile image URL. Only used if the user is registering for the first time.",
"type": "string"
},
"name": {
"description": "User display name. Only used if the user is registering for the first time. Eg: \"my-name\"",
"type": "string"
},
"otp": {
"description": "OTP sent to the email",
"type": "string"
}
},
"propertyNames": {
"type": "string"
},
"required": [
"email",
"otp"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"token": {
"description": "Session token for the authenticated session",
"type": "string"
},
"user": {
"properties": {
"createdAt": {
"format": "date-time",
"type": "string"
},
"email": {
"type": "string"
},
"emailVerified": {
"default": false,
"readOnly": true,
"type": "boolean"
},
"id": {
"readOnly": true,
"type": "string"
},
"image": {
"type": "string"
},
"inviteCodeId": {
"readOnly": true,
"type": "string"
},
"invitedByUserId": {
"readOnly": true,
"type": "string"
},
"invitedVia": {
"readOnly": true,
"type": "string"
},
"locale": {
"type": "string"
},
"name": {
"type": "string"
},
"phoneNumber": {
"type": "string"
},
"phoneNumberVerified": {
"readOnly": true,
"type": "boolean"
},
"publicId": {
"readOnly": true,
"type": "string"
},
"registeredVia": {
"readOnly": true,
"type": "string"
},
"status": {
"readOnly": true,
"type": "string"
},
"timeZone": {
"readOnly": true,
"type": "string"
},
"twoFactorEnabled": {
"default": false,
"readOnly": true,
"type": "boolean"
},
"updatedAt": {
"format": "date-time",
"type": "string"
}
},
"required": [
"id",
"name",
"email",
"emailVerified",
"createdAt",
"updatedAt"
],
"type": "object"
}
},
"required": [
"token",
"user"
],
"type": "object"
}
}
},
"description": "Success"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Sign in with an email code",
"tags": [
"auth"
],
"x-audit": "auth.sign_in",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.login.account",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}POST /api/v1/auth/sign-in/phone-number
POST /api/v1/auth/sign-in/phone-number
Sign in with verified phone and password
Use this endpoint to sign in with phone number
{
"description": "Use this endpoint to sign in with phone number",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"password": {
"description": "Password to use for sign in.",
"type": "string"
},
"phoneNumber": {
"description": "Phone number to sign in. Eg: \"+1234567890\"",
"type": "string"
},
"rememberMe": {
"description": "Remember the session. Eg: true",
"type": "boolean"
}
},
"required": [
"phoneNumber",
"password"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"session": {
"properties": {
"absoluteExpiresAt": {
"format": "date-time",
"readOnly": true,
"type": "string"
},
"activeOrganizationId": {
"readOnly": true,
"type": "string"
},
"clientKind": {
"readOnly": true,
"type": "string"
},
"createdAt": {
"format": "date-time",
"type": "string"
},
"expiresAt": {
"format": "date-time",
"type": "string"
},
"id": {
"readOnly": true,
"type": "string"
},
"ipAddress": {
"type": "string"
},
"mfaVerifiedAt": {
"format": "date-time",
"readOnly": true,
"type": "string"
},
"reauthAt": {
"format": "date-time",
"readOnly": true,
"type": "string"
},
"token": {
"type": "string"
},
"updatedAt": {
"format": "date-time",
"type": "string"
},
"userAgent": {
"type": "string"
},
"userId": {
"type": "string"
}
},
"required": [
"id",
"expiresAt",
"token",
"createdAt",
"updatedAt",
"userId"
],
"type": "object"
},
"user": {
"properties": {
"createdAt": {
"format": "date-time",
"type": "string"
},
"email": {
"type": "string"
},
"emailVerified": {
"default": false,
"readOnly": true,
"type": "boolean"
},
"id": {
"readOnly": true,
"type": "string"
},
"image": {
"type": "string"
},
"inviteCodeId": {
"readOnly": true,
"type": "string"
},
"invitedByUserId": {
"readOnly": true,
"type": "string"
},
"invitedVia": {
"readOnly": true,
"type": "string"
},
"locale": {
"type": "string"
},
"name": {
"type": "string"
},
"phoneNumber": {
"type": "string"
},
"phoneNumberVerified": {
"readOnly": true,
"type": "boolean"
},
"publicId": {
"readOnly": true,
"type": "string"
},
"registeredVia": {
"readOnly": true,
"type": "string"
},
"status": {
"readOnly": true,
"type": "string"
},
"timeZone": {
"readOnly": true,
"type": "string"
},
"twoFactorEnabled": {
"default": false,
"readOnly": true,
"type": "boolean"
},
"updatedAt": {
"format": "date-time",
"type": "string"
}
},
"required": [
"id",
"name",
"email",
"emailVerified",
"createdAt",
"updatedAt"
],
"type": "object"
}
},
"type": "object"
}
}
},
"description": "Success"
},
"400": {
"description": "Invalid phone number or password"
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Sign in with verified phone and password",
"tags": [
"auth"
],
"x-audit": "auth.sign_in",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.login.account",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}socialSignIn
POST /api/v1/auth/sign-in/social
Start social or OIDC sign-in
Sign in with a social provider
{
"description": "Sign in with a social provider",
"operationId": "socialSignIn",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"additionalData": {
"additionalProperties": {},
"propertyNames": {
"type": "string"
},
"type": "object"
},
"additionalParams": {
"additionalProperties": {
"type": "string"
},
"description": "Extra query parameters to append to the provider authorization URL (e.g. Cognito identity_provider, Google hd).",
"propertyNames": {
"type": "string"
},
"type": "object"
},
"callbackURL": {
"description": "Callback URL to redirect to after the user has signed in",
"type": "string"
},
"disableRedirect": {
"description": "Disable automatic redirection to the provider. Useful for handling the redirection yourself",
"type": "boolean"
},
"errorCallbackURL": {
"description": "Callback URL to redirect to if an error happens",
"type": "string"
},
"idToken": {
"properties": {
"accessToken": {
"description": "Access token from the provider",
"type": "string"
},
"expiresAt": {
"description": "Expiry date of the token",
"type": "number"
},
"nonce": {
"description": "Nonce used to generate the token",
"type": "string"
},
"refreshToken": {
"description": "Refresh token from the provider",
"type": "string"
},
"token": {
"description": "ID token from the provider",
"type": "string"
},
"user": {
"description": "The user object from the provider. Only available for some providers like Apple.",
"properties": {
"email": {
"type": "string"
},
"name": {
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}
},
"required": [
"token"
],
"type": "object"
},
"loginHint": {
"description": "The login hint to use for the authorization code request",
"type": "string"
},
"newUserCallbackURL": {
"type": "string"
},
"provider": {
"anyOf": [
{
"enum": [
"apple",
"atlassian",
"cloudflare",
"cognito",
"discord",
"facebook",
"figma",
"github",
"microsoft",
"google",
"huggingface",
"slack",
"spotify",
"twitch",
"twitter",
"dropbox",
"kick",
"linear",
"linkedin",
"gitlab",
"tiktok",
"reddit",
"roblox",
"salesforce",
"vk",
"zoom",
"notion",
"kakao",
"naver",
"line",
"paybin",
"paypal",
"polar",
"railway",
"vercel",
"wechat"
],
"type": "string"
},
{
"type": "string"
}
]
},
"requestSignUp": {
"description": "Explicitly request sign-up. Useful when disableImplicitSignUp is true for this provider",
"type": "boolean"
},
"scopes": {
"description": "Array of scopes to request from the provider. This will override the default scopes passed.",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"provider"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"description": "Returns session details when idToken is provided, or an authorize URL otherwise",
"properties": {
"redirect": {
"type": "boolean"
},
"token": {
"type": "string"
},
"url": {
"type": "string"
},
"user": {
"properties": {
"createdAt": {
"format": "date-time",
"type": "string"
},
"email": {
"type": "string"
},
"emailVerified": {
"default": false,
"readOnly": true,
"type": "boolean"
},
"id": {
"readOnly": true,
"type": "string"
},
"image": {
"type": "string"
},
"inviteCodeId": {
"readOnly": true,
"type": "string"
},
"invitedByUserId": {
"readOnly": true,
"type": "string"
},
"invitedVia": {
"readOnly": true,
"type": "string"
},
"locale": {
"type": "string"
},
"name": {
"type": "string"
},
"phoneNumber": {
"type": "string"
},
"phoneNumberVerified": {
"readOnly": true,
"type": "boolean"
},
"publicId": {
"readOnly": true,
"type": "string"
},
"registeredVia": {
"readOnly": true,
"type": "string"
},
"status": {
"readOnly": true,
"type": "string"
},
"timeZone": {
"readOnly": true,
"type": "string"
},
"twoFactorEnabled": {
"default": false,
"readOnly": true,
"type": "boolean"
},
"updatedAt": {
"format": "date-time",
"type": "string"
}
},
"required": [
"id",
"name",
"email",
"emailVerified",
"createdAt",
"updatedAt"
],
"type": "object"
}
},
"required": [
"redirect"
],
"type": "object"
}
}
},
"description": "Success - Returns session details (idToken branch) or an authorize URL (redirect branch)"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Start social or OIDC sign-in",
"tags": [
"auth"
],
"x-audit": "auth.sign_in",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.login.account",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}POST /api/v1/auth/sign-in/telegram
POST /api/v1/auth/sign-in/telegram
Verify Telegram Login Widget proof
{
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"auth_date": {
"type": "number"
},
"first_name": {
"maxLength": 256,
"minLength": 1,
"type": "string"
},
"hash": {
"type": "string"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
}
]
},
"invitationId": {
"type": "string"
},
"inviteCode": {
"maxLength": 128,
"type": "string"
},
"last_name": {
"maxLength": 256,
"type": "string"
},
"link": {
"type": "boolean"
},
"photo_url": {
"type": "string"
},
"username": {
"maxLength": 64,
"type": "string"
}
},
"required": [
"id",
"first_name",
"auth_date",
"hash"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"status": {
"type": "boolean"
},
"token": {
"type": "string"
},
"user": {
"type": "object"
}
},
"type": "object"
}
}
},
"description": "Authenticated"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Verify Telegram Login Widget proof",
"tags": [
"auth"
],
"x-audit": "auth.sign_in",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.login.account",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}signOut
POST /api/v1/auth/sign-out
Sign out
Sign out the current user
{
"description": "Sign out the current user",
"operationId": "signOut",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"callbackURL": {
"description": "The URL to redirect to after provider logout",
"type": "string"
},
"disableRedirect": {
"description": "Return the provider logout URL without redirecting",
"type": "boolean"
},
"state": {
"description": "State to pass to the provider logout endpoint",
"type": "string"
}
},
"type": "object"
}
}
},
"required": false
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"redirect": {
"description": "Whether the client should redirect to the provider logout URL",
"type": "boolean"
},
"success": {
"type": "boolean"
},
"url": {
"description": "Provider logout URL when RP-initiated logout is available",
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Success"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Sign out",
"tags": [
"auth"
],
"x-audit": "auth.sign_out",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}signUpWithEmailAndPassword
POST /api/v1/auth/sign-up/email
Register (inviteCode, invitationId, locale)
Sign up a user using email and password
{
"description": "Sign up a user using email and password",
"operationId": "signUpWithEmailAndPassword",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"callbackURL": {
"description": "The URL to use for email verification callback",
"type": "string"
},
"email": {
"description": "The email of the user",
"type": "string"
},
"image": {
"description": "The profile image URL of the user",
"type": "string"
},
"invitationId": {
"description": "Email invitation being accepted at registration",
"format": "uuid",
"type": "string"
},
"inviteCode": {
"description": "Personal or universal invite code (case-insensitive)",
"type": "string"
},
"locale": {
"type": "string"
},
"name": {
"description": "The name of the user",
"type": "string"
},
"password": {
"description": "The password of the user",
"type": "string"
},
"phoneNumber": {
"type": "string"
},
"rememberMe": {
"description": "If this is false, the session will not be remembered. Default is `true`.",
"type": "boolean"
}
},
"required": [
"name",
"email",
"password"
],
"type": "object"
}
}
}
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"token": {
"description": "Authentication token for the session",
"nullable": true,
"type": "string"
},
"user": {
"properties": {
"createdAt": {
"description": "When the user was created",
"format": "date-time",
"type": "string"
},
"email": {
"description": "The email address of the user",
"format": "email",
"type": "string"
},
"emailVerified": {
"description": "Whether the email has been verified",
"type": "boolean"
},
"id": {
"description": "The unique identifier of the user",
"type": "string"
},
"image": {
"description": "The profile image URL of the user",
"format": "uri",
"nullable": true,
"type": "string"
},
"name": {
"description": "The name of the user",
"type": "string"
},
"updatedAt": {
"description": "When the user was last updated",
"format": "date-time",
"type": "string"
}
},
"required": [
"id",
"email",
"name",
"emailVerified",
"createdAt",
"updatedAt"
],
"type": "object"
}
},
"required": [
"user"
],
"type": "object"
}
}
},
"description": "Successfully created user"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"422": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Unprocessable Entity. User already exists or failed to create user."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Register (inviteCode, invitationId, locale)",
"tags": [
"auth"
],
"x-audit": "auth.sign_up",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.signup.ip",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}POST /api/v1/auth/two-factor/disable
POST /api/v1/auth/two-factor/disable
Disable TOTP
Use this endpoint to disable two factor authentication.
{
"description": "Use this endpoint to disable two factor authentication.",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"password": {
"description": "User password",
"type": "string"
}
},
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"status": {
"type": "boolean"
}
},
"type": "object"
}
}
},
"description": "Successful response"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Disable TOTP",
"tags": [
"auth"
],
"x-audit": "auth.mfa.disable",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.mfa.ip",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}POST /api/v1/auth/two-factor/enable
POST /api/v1/auth/two-factor/enable
Start TOTP enrollment
Enable two factor authentication. Pass method 'totp' (default) to set up an authenticator app (returns TOTP URI and backup codes), or 'otp' to enable email/SMS-based codes immediately.
{
"description": "Enable two factor authentication. Pass method 'totp' (default) to set up an authenticator app (returns TOTP URI and backup codes), or 'otp' to enable email/SMS-based codes immediately.",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"issuer": {
"description": "Custom issuer for the TOTP URI",
"type": "string"
},
"method": {
"enum": [
"otp",
"totp"
],
"type": "string"
},
"password": {
"description": "User password",
"type": "string"
}
},
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"backupCodes": {
"description": "Recovery backup codes. Only present when method is 'totp'.",
"items": {
"type": "string"
},
"type": "array"
},
"method": {
"description": "The 2FA method that was enabled.",
"enum": [
"otp",
"totp"
],
"type": "string"
},
"totpURI": {
"description": "TOTP URI for authenticator app setup. Only present when method is 'totp'.",
"type": "string"
}
},
"required": [
"method"
],
"type": "object"
}
}
},
"description": "Successful response"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Start TOTP enrollment",
"tags": [
"auth"
],
"x-audit": "auth.mfa.enable",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.mfa.ip",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}POST /api/v1/auth/two-factor/generate-backup-codes
POST /api/v1/auth/two-factor/generate-backup-codes
Replace backup codes
Generate new backup codes for two-factor authentication
{
"description": "Generate new backup codes for two-factor authentication",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"password": {
"description": "The users password.",
"type": "string"
}
},
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"backupCodes": {
"description": "Array of generated backup codes in plain text",
"items": {
"type": "string"
},
"type": "array"
},
"status": {
"description": "Indicates if the backup codes were generated successfully",
"enum": [
true
],
"type": "boolean"
}
},
"required": [
"status",
"backupCodes"
],
"type": "object"
}
}
},
"description": "Backup codes generated successfully"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Replace backup codes",
"tags": [
"auth"
],
"x-audit": "auth.mfa.backup_codes",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.mfa.ip",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}POST /api/v1/auth/two-factor/verify-backup-code
POST /api/v1/auth/two-factor/verify-backup-code
Consume a backup code
Verify a backup code for two-factor authentication
{
"description": "Verify a backup code for two-factor authentication",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"code": {
"description": "A backup code to verify. Eg: \"123456\"",
"type": "string"
},
"disableSession": {
"description": "If true, the session cookie will not be set.",
"type": "boolean"
},
"trustDevice": {
"description": "If true, the device will be trusted for 30 days. It'll be refreshed on every sign in request within this time. Eg: true",
"type": "boolean"
}
},
"required": [
"code"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"session": {
"description": "The current session object, included unless disableSession is true",
"properties": {
"createdAt": {
"description": "Timestamp when the session was created",
"format": "date-time",
"type": "string"
},
"expiresAt": {
"description": "Timestamp when the session expires",
"format": "date-time",
"type": "string"
},
"token": {
"description": "Session token",
"type": "string"
},
"userId": {
"description": "ID of the user associated with the session",
"type": "string"
}
},
"required": [
"token",
"userId",
"createdAt",
"expiresAt"
],
"type": "object"
},
"user": {
"description": "The authenticated user object with two-factor details",
"properties": {
"createdAt": {
"description": "Timestamp when the user was created",
"format": "date-time",
"type": "string"
},
"email": {
"description": "User's email address",
"format": "email",
"nullable": true,
"type": "string"
},
"emailVerified": {
"description": "Whether the email is verified",
"nullable": true,
"type": "boolean"
},
"id": {
"description": "Unique identifier of the user",
"type": "string"
},
"image": {
"description": "User's profile image URL",
"format": "uri",
"nullable": true,
"type": "string"
},
"name": {
"description": "User's name",
"nullable": true,
"type": "string"
},
"twoFactorEnabled": {
"description": "Whether two-factor authentication is enabled for the user",
"type": "boolean"
},
"updatedAt": {
"description": "Timestamp when the user was last updated",
"format": "date-time",
"type": "string"
}
},
"required": [
"id",
"twoFactorEnabled",
"createdAt",
"updatedAt"
],
"type": "object"
}
},
"required": [
"user",
"session"
],
"type": "object"
}
}
},
"description": "Backup code verified successfully"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Consume a backup code",
"tags": [
"auth"
],
"x-audit": "auth.mfa.verify",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.mfa.ip",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}POST /api/v1/auth/two-factor/verify-totp
POST /api/v1/auth/two-factor/verify-totp
Verify a TOTP code (sets the session mfa_verified_at)
Verify two factor TOTP
{
"description": "Verify two factor TOTP",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"code": {
"description": "The otp code to verify. Eg: \"012345\"",
"type": "string"
},
"trustDevice": {
"description": "If true, the device will be trusted for 30 days. It'll be refreshed on every sign in request within this time. Eg: true",
"type": "boolean"
}
},
"required": [
"code"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"status": {
"type": "boolean"
}
},
"type": "object"
}
}
},
"description": "Successful response"
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Bad Request. Usually due to missing parameters, or invalid parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
},
"description": "Unauthorized. Due to missing or invalid authentication."
},
"403": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Forbidden. You do not have permission to access this resource or to perform this action."
},
"404": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Not Found. The requested resource was not found."
},
"429": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Too Many Requests. You have exceeded the rate limit. Try again later."
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"description": "Internal Server Error. This is a problem with the server that you cannot fix."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Verify a TOTP code (sets the session mfa_verified_at)",
"tags": [
"auth"
],
"x-audit": "auth.mfa.verify",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.mfa.ip",
"effectiveSecurity": [
{
"bearerAuth": []
}
]
}POST /api/v1/auth/unlink-account
POST /api/v1/auth/unlink-account
Unlink a sign-in account
{
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"accountId": {
"format": "uuid",
"type": "string"
}
},
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"status": {
"enum": [
true
],
"type": "boolean"
}
},
"required": [
"status"
],
"type": "object"
}
}
},
"description": "Removed"
}
},
"summary": "Unlink a sign-in account",
"tags": [
"auth"
],
"x-audit": "auth.account.unlink",
"x-body": "json",
"x-body-limit": 65536,
"x-idempotency": "none",
"x-rate-limit": "auth.reauth.session",
"x-reauth": true,
"effectiveSecurity": []
}