{ "openapi": "3.0.0", "info": { "title": "Melody Auth S2S API", "version": "0.0.1" }, "security": [ { "oauth2": [] } ], "components": { "securitySchemes": { "oauth2": { "type": "oauth2", "flows": { "clientCredentials": { "tokenUrl": "/oauth2/v1/token", "scopes": { "root": "Full access", "read_app": "Read access to app", "write_app": "Write access to app", "read_user": "Read access to user", "write_user": "Write access to user", "read_role": "Read access to role", "write_role": "Write access to role", "read_scope": "Read access to scope", "write_scope": "Write access to scope", "read_org": "Read access to org", "write_org": "Write access to org" } } } } }, "schemas": { "Scope": { "type": "object", "properties": { "id": { "type": "number" }, "name": { "type": "string" }, "note": { "type": "string" }, "type": { "type": "string", "enum": [ "spa", "s2s" ] }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "deletedAt": { "type": "string", "nullable": true } }, "required": [ "id", "name", "note", "type", "createdAt", "updatedAt", "deletedAt" ] }, "ScopeDetail": { "allOf": [ { "$ref": "#/components/schemas/Scope" }, { "type": "object", "properties": { "locales": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "number" }, "scopeId": { "type": "number" }, "locale": { "type": "string" }, "value": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "deletedAt": { "type": "string", "nullable": true } }, "required": [ "id", "scopeId", "locale", "value", "createdAt", "updatedAt", "deletedAt" ] } } }, "required": [ "locales" ] } ] }, "PutScopeReq": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 50 }, "note": { "type": "string" }, "locales": { "type": "array", "items": { "type": "object", "properties": { "locale": { "type": "string" }, "value": { "type": "string" } }, "required": [ "locale", "value" ] } } } }, "PostScopeReq": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 50 }, "type": { "type": "string", "enum": [ "spa", "s2s" ] }, "note": { "type": "string" }, "locales": { "type": "array", "items": { "type": "object", "properties": { "locale": { "type": "string" }, "value": { "type": "string" } }, "required": [ "locale", "value" ] } } }, "required": [ "name", "type" ] }, "Role": { "type": "object", "properties": { "id": { "type": "number" }, "name": { "type": "string" }, "note": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "deletedAt": { "type": "string", "nullable": true } }, "required": [ "id", "name", "note", "createdAt", "updatedAt", "deletedAt" ] }, "PutRoleReq": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 50 }, "note": { "type": "string" } } }, "PostRoleReq": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 50 }, "note": { "type": "string" } }, "required": [ "name" ] }, "Org": { "type": "object", "properties": { "id": { "type": "number" }, "name": { "type": "string" }, "slug": { "type": "string" }, "companyLogoUrl": { "type": "string" }, "companyEmailLogoUrl": { "type": "string" }, "fontFamily": { "type": "string" }, "fontUrl": { "type": "string" }, "layoutColor": { "type": "string" }, "labelColor": { "type": "string" }, "primaryButtonColor": { "type": "string" }, "primaryButtonLabelColor": { "type": "string" }, "primaryButtonBorderColor": { "type": "string" }, "secondaryButtonColor": { "type": "string" }, "secondaryButtonLabelColor": { "type": "string" }, "secondaryButtonBorderColor": { "type": "string" }, "criticalIndicatorColor": { "type": "string" }, "emailSenderName": { "type": "string" }, "termsLink": { "type": "string" }, "privacyPolicyLink": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "deletedAt": { "type": "string", "nullable": true } }, "required": [ "id", "name", "slug", "companyLogoUrl", "companyEmailLogoUrl", "fontFamily", "fontUrl", "layoutColor", "labelColor", "primaryButtonColor", "primaryButtonLabelColor", "primaryButtonBorderColor", "secondaryButtonColor", "secondaryButtonLabelColor", "secondaryButtonBorderColor", "criticalIndicatorColor", "emailSenderName", "termsLink", "privacyPolicyLink", "createdAt", "updatedAt", "deletedAt" ] }, "PutOrgReq": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 50 }, "slug": { "type": "string", "minLength": 1, "maxLength": 50 }, "companyLogoUrl": { "type": "string", "minLength": 0, "maxLength": 250 }, "companyEmailLogoUrl": { "type": "string", "minLength": 0, "maxLength": 250 }, "fontFamily": { "type": "string", "minLength": 0, "maxLength": 50 }, "fontUrl": { "type": "string", "minLength": 0, "maxLength": 250 }, "layoutColor": { "type": "string", "minLength": 0, "maxLength": 20 }, "labelColor": { "type": "string", "minLength": 0, "maxLength": 20 }, "primaryButtonColor": { "type": "string", "minLength": 0, "maxLength": 20 }, "primaryButtonLabelColor": { "type": "string", "minLength": 0, "maxLength": 20 }, "primaryButtonBorderColor": { "type": "string", "minLength": 0, "maxLength": 20 }, "secondaryButtonColor": { "type": "string", "minLength": 0, "maxLength": 20 }, "secondaryButtonLabelColor": { "type": "string", "minLength": 0, "maxLength": 20 }, "secondaryButtonBorderColor": { "type": "string", "minLength": 0, "maxLength": 20 }, "criticalIndicatorColor": { "type": "string", "minLength": 0, "maxLength": 20 }, "emailSenderName": { "type": "string", "minLength": 0, "maxLength": 20 }, "termsLink": { "type": "string", "minLength": 0, "maxLength": 250 }, "privacyPolicyLink": { "type": "string", "minLength": 0, "maxLength": 250 } } }, "PostOrgReq": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 50 }, "slug": { "type": "string", "minLength": 1, "maxLength": 50 } }, "required": [ "name", "slug" ] }, "App": { "type": "object", "properties": { "id": { "type": "number" }, "clientId": { "type": "string" }, "name": { "type": "string" }, "isActive": { "type": "boolean" }, "type": { "type": "string", "enum": [ "spa", "s2s" ] }, "secret": { "type": "string" }, "redirectUris": { "type": "array", "items": { "type": "string" } }, "useSystemMfaConfig": { "type": "boolean" }, "requireEmailMfa": { "type": "boolean" }, "requireOtpMfa": { "type": "boolean" }, "requireSmsMfa": { "type": "boolean" }, "allowEmailMfaAsBackup": { "type": "boolean" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "deletedAt": { "type": "string", "nullable": true } }, "required": [ "id", "clientId", "name", "isActive", "type", "secret", "redirectUris", "useSystemMfaConfig", "requireEmailMfa", "requireOtpMfa", "requireSmsMfa", "allowEmailMfaAsBackup", "createdAt", "updatedAt", "deletedAt" ] }, "AppDetail": { "allOf": [ { "$ref": "#/components/schemas/App" }, { "type": "object", "properties": { "scopes": { "type": "array", "items": { "type": "string" } } }, "required": [ "scopes" ] } ] }, "PostAppReq": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 50 }, "type": { "type": "string", "enum": [ "spa", "s2s" ] }, "scopes": { "type": "array", "items": { "type": "string" } }, "redirectUris": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "type", "scopes", "redirectUris" ] }, "PutAppReq": { "type": "object", "properties": { "redirectUris": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string", "minLength": 1, "maxLength": 50 }, "isActive": { "type": "boolean" }, "scopes": { "type": "array", "items": { "type": "string" } }, "useSystemMfaConfig": { "type": "boolean" }, "requireEmailMfa": { "type": "boolean" }, "requireOtpMfa": { "type": "boolean" }, "requireSmsMfa": { "type": "boolean" }, "allowEmailMfaAsBackup": { "type": "boolean" } } }, "User": { "type": "object", "properties": { "id": { "type": "number" }, "authId": { "type": "string" }, "email": { "type": "string", "nullable": true }, "linkedAuthId": { "type": "string", "nullable": true }, "socialAccountId": { "type": "string", "nullable": true }, "socialAccountType": { "type": "string", "nullable": true }, "firstName": { "type": "string", "nullable": true }, "lastName": { "type": "string", "nullable": true }, "locale": { "type": "string" }, "loginCount": { "type": "number" }, "mfaTypes": { "type": "array", "items": { "type": "string" } }, "emailVerified": { "type": "boolean" }, "otpVerified": { "type": "boolean" }, "smsPhoneNumberVerified": { "type": "boolean" }, "isActive": { "type": "boolean" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "deletedAt": { "type": "string", "nullable": true } }, "required": [ "id", "authId", "email", "socialAccountId", "socialAccountType", "firstName", "lastName", "locale", "emailVerified", "otpVerified", "loginCount", "mfaTypes", "smsPhoneNumberVerified", "isActive", "createdAt", "updatedAt", "deletedAt" ] }, "UserDetail": { "allOf": [ { "$ref": "#/components/schemas/User" }, { "type": "object", "properties": { "roles": { "type": "array", "items": { "type": "string" }, "nullable": true }, "org": { "type": "object", "properties": { "id": { "type": "number" }, "name": { "type": "string" }, "slug": { "type": "string" } }, "nullable": true } }, "required": [ "roles" ] } ] }, "UserConsentedApp": { "type": "object", "properties": { "appId": { "type": "number" }, "appName": { "type": "string" } }, "required": [ "appId", "appName" ] }, "UserPasskey": { "type": "object", "properties": { "id": { "type": "number" }, "credentialId": { "type": "string" }, "counter": { "type": "number" } }, "required": [ "id", "credentialId", "counter" ] }, "PutUserReq": { "type": "object", "properties": { "firstName": { "type": "string" }, "lastName": { "type": "string" }, "isActive": { "type": "boolean" }, "locale": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } } } }, "EmailLog": { "type": "object", "properties": { "id": { "type": "number" }, "success": { "type": "boolean" }, "receiver": { "type": "string" }, "response": { "type": "string" }, "content": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "deletedAt": { "type": "string", "nullable": true } }, "required": [ "id", "success", "receiver", "response", "content", "createdAt", "updatedAt", "deletedAt" ] }, "SmsLog": { "type": "object", "properties": { "id": { "type": "number" }, "success": { "type": "boolean" }, "receiver": { "type": "string" }, "response": { "type": "string" }, "content": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "deletedAt": { "type": "string", "nullable": true } }, "required": [ "id", "receiver", "response", "content", "createdAt", "updatedAt", "deletedAt" ] }, "SignInLog": { "type": "object", "properties": { "id": { "type": "number" }, "userId": { "type": "number" }, "ip": { "type": "string", "nullable": true }, "detail": { "type": "string", "nullable": true }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "deletedAt": { "type": "string", "nullable": true } }, "required": [ "id", "userId", "ip", "detail", "createdAt", "updatedAt", "deletedAt" ] } } }, "paths": { "/api/v1/scopes": { "get": { "summary": "Get a list of scopes", "description": "Required scope - read_scope", "tags": [ "Scopes" ], "responses": { "200": { "description": "A list of scopes", "content": { "application/json": { "schema": { "type": "object", "properties": { "scopes": { "type": "array", "items": { "$ref": "#/components/schemas/Scope" } } } } } } } } }, "post": { "summary": "Create a new scope", "description": "Required scope - write_scope", "tags": [ "Scopes" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PostScopeReq" } } } }, "responses": { "201": { "content": { "application/json": { "schema": { "type": "object", "properties": { "scope": { "$ref": "#/components/schemas/ScopeDetail" } } } } } } } } }, "/api/v1/scopes/{id}": { "get": { "summary": "Get a single scope by ID", "description": "Required scope - read_scope", "tags": [ "Scopes" ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "number" }, "description": "The unique ID of the scope" } ], "responses": { "200": { "description": "A single scope object", "content": { "application/json": { "schema": { "type": "object", "properties": { "scope": { "$ref": "#/components/schemas/ScopeDetail" } } } } } } } }, "put": { "summary": "Update an existing scope by ID", "description": "Required scope - write_scope", "tags": [ "Scopes" ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "number" }, "description": "The unique ID of the scope" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PutScopeReq" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "scope": { "$ref": "#/components/schemas/ScopeDetail" } } } } } } } }, "delete": { "summary": "Delete an existing scope by ID", "description": "Required scope - write_scope", "tags": [ "Scopes" ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "number" }, "description": "The unique ID of the scope" } ], "responses": { "204": { "description": "Successful operation with no content to return" } } } }, "/api/v1/roles": { "get": { "summary": "Get a list of roles", "description": "Required scope - read_role", "tags": [ "Roles" ], "responses": { "200": { "description": "A list of roles", "content": { "application/json": { "schema": { "type": "object", "properties": { "roles": { "type": "array", "items": { "$ref": "#/components/schemas/Role" } } } } } } } } }, "post": { "summary": "Create a new role", "description": "Required scope - write_role", "tags": [ "Roles" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PostRoleReq" } } } }, "responses": { "201": { "content": { "application/json": { "schema": { "type": "object", "properties": { "role": { "$ref": "#/components/schemas/Role" } } } } } } } } }, "/api/v1/roles/{id}": { "get": { "summary": "Get a single role by ID", "description": "Required scope - read_role", "tags": [ "Roles" ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "number" }, "description": "The unique ID of the role" } ], "responses": { "200": { "description": "A single role object", "content": { "application/json": { "schema": { "type": "object", "properties": { "role": { "$ref": "#/components/schemas/Role" } } } } } } } }, "put": { "summary": "Update an existing role by ID", "description": "Required scope - write_role", "tags": [ "Roles" ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "number" }, "description": "The unique ID of the role" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PutRoleReq" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "role": { "$ref": "#/components/schemas/Role" } } } } } } } }, "delete": { "summary": "Delete an existing role by ID", "description": "Required scope - write_role", "tags": [ "Roles" ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "number" }, "description": "The unique ID of the role" } ], "responses": { "204": { "description": "Successful operation with no content to return" } } } }, "/api/v1/orgs": { "get": { "summary": "Get a list of orgs", "description": "Required scope - read_org", "tags": [ "Orgs" ], "responses": { "200": { "description": "A list of orgs", "content": { "application/json": { "schema": { "type": "object", "properties": { "orgs": { "type": "array", "items": { "$ref": "#/components/schemas/Org" } } } } } } } } }, "post": { "summary": "Create a new org", "description": "Required scope - write_org", "tags": [ "Orgs" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PostOrgReq" } } } }, "responses": { "201": { "content": { "application/json": { "schema": { "type": "object", "properties": { "org": { "$ref": "#/components/schemas/Org" } } } } } } } } }, "/api/v1/orgs/{id}": { "get": { "summary": "Get a single org by ID", "description": "Required scope - read_org", "tags": [ "Orgs" ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "number" }, "description": "The unique ID of the org" } ], "responses": { "200": { "description": "A single org object", "content": { "application/json": { "schema": { "type": "object", "properties": { "org": { "$ref": "#/components/schemas/Org" } } } } } } } }, "put": { "summary": "Update an existing org by ID", "description": "Required scope - write_org", "tags": [ "Orgs" ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "number" }, "description": "The unique ID of the org" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PutOrgReq" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "org": { "$ref": "#/components/schemas/Org" } } } } } } } }, "delete": { "summary": "Delete an existing org by ID", "description": "Required scope - write_org", "tags": [ "Orgs" ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "number" }, "description": "The unique ID of the org" } ], "responses": { "204": { "description": "Successful operation with no content to return" } } } }, "/api/v1/orgs/{id}/users": { "get": { "summary": "Get a list of users for an org", "description": "Required scopes - read_org, read_user", "tags": [ "Orgs" ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "number" }, "description": "The unique ID of the org" }, { "in": "query", "name": "page_size", "schema": { "type": "integer" }, "description": "Number of users to return per page" }, { "in": "query", "name": "page_number", "schema": { "type": "integer" }, "description": "Page number to return" }, { "in": "query", "name": "search", "schema": { "type": "string" }, "description": "Search by name or email" } ], "responses": { "200": { "description": "A list of users", "content": { "application/json": { "schema": { "type": "object", "properties": { "users": { "type": "array", "items": { "$ref": "#/components/schemas/User" } }, "count": { "type": "integer", "description": "Total number of users matching the query" } } } } } } } } }, "/api/v1/apps": { "get": { "summary": "Get a list of apps", "description": "Required scope - read_app", "tags": [ "Apps" ], "responses": { "200": { "description": "A list of apps", "content": { "application/json": { "schema": { "type": "object", "properties": { "apps": { "type": "array", "items": { "$ref": "#/components/schemas/App" } } } } } } } } }, "post": { "summary": "Create a new app", "description": "Required scope - write_app", "tags": [ "Apps" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PostAppReq" } } } }, "responses": { "201": { "content": { "application/json": { "schema": { "type": "object", "properties": { "app": { "$ref": "#/components/schemas/AppDetail" } } } } } } } } }, "/api/v1/apps/{id}": { "get": { "summary": "Get a single app by ID", "description": "Required scope - read_app", "tags": [ "Apps" ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "number" }, "description": "The unique ID of the app" } ], "responses": { "200": { "description": "A single app object", "content": { "application/json": { "schema": { "type": "object", "properties": { "app": { "$ref": "#/components/schemas/AppDetail" } } } } } } } }, "put": { "summary": "Update an existing app by ID", "description": "Required scope - write_app", "tags": [ "Apps" ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "number" }, "description": "The unique ID of the app" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PutAppReq" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "app": { "$ref": "#/components/schemas/AppDetail" } } } } } } } }, "delete": { "summary": "Delete an existing app by ID", "description": "Required scope - write_app", "tags": [ "Apps" ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "number" }, "description": "The unique ID of the app" } ], "responses": { "204": { "description": "Successful operation with no content to return" } } } }, "/api/v1/users": { "get": { "summary": "Get a list of users", "description": "Required scope - read_user", "tags": [ "Users" ], "parameters": [ { "in": "query", "name": "page_size", "schema": { "type": "integer" }, "description": "Number of users to return per page" }, { "in": "query", "name": "page_number", "schema": { "type": "integer" }, "description": "Page number to return" }, { "in": "query", "name": "search", "schema": { "type": "string" }, "description": "Search by name or email" } ], "responses": { "200": { "description": "A list of users", "content": { "application/json": { "schema": { "type": "object", "properties": { "users": { "type": "array", "items": { "$ref": "#/components/schemas/User" } }, "count": { "type": "integer", "description": "Total number of users matching the query" } } } } } } } } }, "/api/v1/users/{authId}": { "get": { "summary": "Get a single user by authId", "description": "Required scope - read_user", "tags": [ "Users" ], "parameters": [ { "in": "path", "name": "authId", "required": true, "schema": { "type": "string" }, "description": "The authId of the user" } ], "responses": { "200": { "description": "A single user object", "content": { "application/json": { "schema": { "type": "object", "properties": { "user": { "$ref": "#/components/schemas/UserDetail" } } } } } } } }, "put": { "summary": "Update an existing user by authId", "description": "Required scope - write_user", "tags": [ "Users" ], "parameters": [ { "in": "path", "name": "authId", "required": true, "schema": { "type": "string" }, "description": "The authId of the user" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PutUserReq" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "user": { "$ref": "#/components/schemas/UserDetail" } } } } } } } }, "delete": { "summary": "Delete an existing user by authId", "description": "Required scope - write_user", "tags": [ "Users" ], "parameters": [ { "in": "path", "name": "authId", "required": true, "schema": { "type": "string" }, "description": "The authId of the user" } ], "responses": { "204": { "description": "Successful operation with no content to return" } } } }, "/api/v1/users/{authId}/locked-ips": { "get": { "summary": "Get a list of locked IPs for a user", "description": "Required scope - read_user", "tags": [ "Users" ], "parameters": [ { "in": "path", "name": "authId", "required": true, "schema": { "type": "string" }, "description": "The authId of the user" } ], "responses": { "200": { "description": "A list of IPs", "content": { "application/json": { "schema": { "type": "object", "properties": { "lockedIPs": { "type": "array", "items": { "type": "string" }, "description": "The list of locked IP addresses for the user" } } } } } } } }, "delete": { "summary": "Unlock all locked IP addresses for a user", "description": "Required scope - write_user", "tags": [ "Users" ], "parameters": [ { "in": "path", "name": "authId", "required": true, "schema": { "type": "string" }, "description": "The authId of the user" } ], "responses": { "204": { "description": "Successful operation with no content to return" } } } }, "/api/v1/users/{authId}/verify-email": { "post": { "summary": "Send a verification email to the user", "description": "Required scope - write_user", "tags": [ "Users" ], "parameters": [ { "in": "path", "name": "authId", "schema": { "type": "string" }, "required": true, "description": "The authId of the user who will receive the verification email" } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "example": true } } } } } } } } }, "/api/v1/users/{authId}/consented-apps": { "get": { "summary": "Get a list of apps user has consented to", "description": "Required scope - read_user", "tags": [ "Users" ], "parameters": [ { "in": "path", "name": "authId", "required": true, "schema": { "type": "string" }, "description": "The authId of the user" } ], "responses": { "200": { "description": "A list of consented apps", "content": { "application/json": { "schema": { "type": "object", "properties": { "consentedApps": { "type": "array", "items": { "$ref": "#/components/schemas/UserConsentedApp" } } } } } } } } } }, "/api/v1/users/{authId}/consented-apps/{appId}": { "delete": { "summary": "Delete an existing consent for a user by authId and appId", "description": "Required scope - write_user", "tags": [ "Users" ], "parameters": [ { "in": "path", "name": "authId", "required": true, "schema": { "type": "string" }, "description": "The authId of the user" }, { "in": "path", "name": "appId", "required": true, "schema": { "type": "number" }, "description": "The id of the app" } ], "responses": { "204": { "description": "Successful operation with no content to return" } } } }, "/api/v1/users/{authId}/passkeys": { "get": { "summary": "Get a list of passkeys for a user", "description": "Required scope - read_user", "tags": [ "Users" ], "parameters": [ { "in": "path", "name": "authId", "required": true, "schema": { "type": "string" }, "description": "The authId of the user" } ], "responses": { "200": { "description": "A list of passkeys", "content": { "application/json": { "schema": { "type": "object", "properties": { "passkeys": { "type": "array", "items": { "$ref": "#/components/schemas/UserPasskey" } } } } } } } } } }, "/api/v1/users/{authId}/passkeys/{passkeyId}": { "delete": { "summary": "Remove a passkey for a user", "description": "Required scope - write_user", "tags": [ "Users" ], "parameters": [ { "in": "path", "name": "authId", "schema": { "type": "string" }, "required": true, "description": "The authId of the user" }, { "in": "path", "name": "passkeyId", "schema": { "type": "number" }, "required": true, "description": "The id of the passkey" } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "example": true } } } } } } } } }, "/api/v1/users/{authId}/email-mfa": { "post": { "summary": "enroll user for email MFA.", "description": "Required scope - write_user", "tags": [ "Users" ], "parameters": [ { "in": "path", "name": "authId", "required": true, "schema": { "type": "string" }, "description": "The authId of the user" } ], "responses": { "204": { "description": "Successful operation with no content to return" } } }, "delete": { "summary": "Unenroll user from email MFA.", "description": "Required scope - write_user", "tags": [ "Users" ], "parameters": [ { "in": "path", "name": "authId", "required": true, "schema": { "type": "string" }, "description": "The authId of the user" } ], "responses": { "204": { "description": "Successful operation with no content to return" } } } }, "/api/v1/users/{authId}/otp-mfa": { "post": { "summary": "enroll user for OTP MFA.", "description": "Required scope - write_user", "tags": [ "Users" ], "parameters": [ { "in": "path", "name": "authId", "required": true, "schema": { "type": "string" }, "description": "The authId of the user" } ], "responses": { "204": { "description": "Successful operation with no content to return" } } }, "delete": { "summary": "Remove user's current OTP MFA setup.", "description": "Required scope - write_user", "tags": [ "Users" ], "parameters": [ { "in": "path", "name": "authId", "required": true, "schema": { "type": "string" }, "description": "The authId of the user" } ], "responses": { "204": { "description": "Successful operation with no content to return" } } } }, "/api/v1/users/{authId}/sms-mfa": { "post": { "summary": "enroll user for SMS MFA.", "description": "Required scope - write_user", "tags": [ "Users" ], "parameters": [ { "in": "path", "name": "authId", "required": true, "schema": { "type": "string" }, "description": "The authId of the user" } ], "responses": { "204": { "description": "Successful operation with no content to return" } } }, "delete": { "summary": "Remove user's current SMS MFA setup.", "description": "Required scope - write_user", "tags": [ "Users" ], "parameters": [ { "in": "path", "name": "authId", "required": true, "schema": { "type": "string" }, "description": "The authId of the user" } ], "responses": { "204": { "description": "Successful operation with no content to return" } } } }, "/api/v1/users/{authId}/account-linking/{linkingAuthId}": { "post": { "summary": "Link current user account with another user account", "description": "Required scope - write_user", "tags": [ "Users" ], "parameters": [ { "in": "path", "name": "authId", "schema": { "type": "string" }, "required": true, "description": "The authId of the user" }, { "in": "path", "name": "linkingAuthId", "schema": { "type": "string" }, "required": true, "description": "The authId of the account to link with" } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "example": true } } } } } } } } }, "/api/v1/users/{authId}/account-linking": { "delete": { "summary": "Unlink current user account with another user account", "description": "Required scope - write_user", "tags": [ "Users" ], "parameters": [ { "in": "path", "name": "authId", "schema": { "type": "string" }, "required": true, "description": "The authId of the user" } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "example": true } } } } } } } } }, "/api/v1/users/{authId}/impersonation/{appId}": { "post": { "summary": "Generate an impersonation refresh token for a user by authId and appId", "description": "Required scope - root", "tags": [ "Users" ], "parameters": [ { "in": "path", "name": "authId", "required": true, "schema": { "type": "string" }, "description": "The authId of the user" }, { "in": "path", "name": "appId", "required": true, "schema": { "type": "number" }, "description": "The id of the app" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "impersonatorToken": { "type": "string", "description": "The access token of the user impersonating, this user must be a super_admin" } } } } } }, "responses": { "200": { "description": "A refresh token for impersonation", "content": { "application/json": { "schema": { "type": "object", "properties": { "refresh_token": { "type": "string", "description": "The refresh token for impersonation" }, "refresh_token_expires_on": { "type": "number", "description": "The expiration time of the refresh token" }, "refresh_token_expires_in": { "type": "number", "description": "The remaining time of the refresh token in seconds" } } } } } } } } }, "/api/v1/logs/email": { "get": { "summary": "Get a list of email logs", "description": "Required scope - root", "tags": [ "Logs" ], "parameters": [ { "in": "query", "name": "page_size", "schema": { "type": "integer" }, "description": "Number of logs to return per page" }, { "in": "query", "name": "page_number", "schema": { "type": "integer" }, "description": "Page number to return" } ], "responses": { "200": { "description": "A list of email logs", "content": { "application/json": { "schema": { "type": "object", "properties": { "logs": { "type": "array", "items": { "$ref": "#/components/schemas/EmailLog" } }, "count": { "type": "integer", "description": "Total number of logs matching the query" } } } } } } } }, "delete": { "summary": "Delete email logs before a certain date, this action is irreversible", "description": "Required scope - root", "tags": [ "Logs" ], "parameters": [ { "in": "query", "name": "before", "schema": { "type": "string" }, "description": "Delete all logs that are older than this date in utc format." } ], "responses": { "204": { "description": "Successful operation with no content to return" } } } }, "/api/v1/logs/email/{id}": { "get": { "summary": "Get an email log by id", "description": "Required scope - root", "tags": [ "Logs" ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "number" }, "description": "The unique ID of the email log" } ], "responses": { "200": { "description": "A single email log object", "content": { "application/json": { "schema": { "type": "object", "properties": { "log": { "$ref": "#/components/schemas/EmailLog" } } } } } } } } }, "/api/v1/logs/sms": { "get": { "summary": "Get a list of SMS logs", "description": "Required scope - root", "tags": [ "Logs" ], "parameters": [ { "in": "query", "name": "page_size", "schema": { "type": "integer" }, "description": "Number of logs to return per page" }, { "in": "query", "name": "page_number", "schema": { "type": "integer" }, "description": "Page number to return" } ], "responses": { "200": { "description": "A list of SMS logs", "content": { "application/json": { "schema": { "type": "object", "properties": { "logs": { "type": "array", "items": { "$ref": "#/components/schemas/SmsLog" } }, "count": { "type": "integer", "description": "Total number of logs matching the query" } } } } } } } }, "delete": { "summary": "Delete SMS logs before a certain date, this action is irreversible", "description": "Required scope - root", "tags": [ "Logs" ], "parameters": [ { "in": "query", "name": "before", "schema": { "type": "string" }, "description": "Delete all logs that are older than this date in utc format." } ], "responses": { "204": { "description": "Successful operation with no content to return" } } } }, "/api/v1/logs/sms/{id}": { "get": { "summary": "Get an SMS log by id", "description": "Required scope - root", "tags": [ "Logs" ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "number" }, "description": "The unique ID of the SMS log" } ], "responses": { "200": { "description": "A single SMS log object", "content": { "application/json": { "schema": { "type": "object", "properties": { "log": { "$ref": "#/components/schemas/SmsLog" } } } } } } } } }, "/api/v1/logs/sign-in": { "get": { "summary": "Get a list of Sign-in logs", "description": "Required scope - root", "tags": [ "Logs" ], "parameters": [ { "in": "query", "name": "page_size", "schema": { "type": "integer" }, "description": "Number of logs to return per page" }, { "in": "query", "name": "page_number", "schema": { "type": "integer" }, "description": "Page number to return" } ], "responses": { "200": { "description": "A list of Sign-in logs", "content": { "application/json": { "schema": { "type": "object", "properties": { "logs": { "type": "array", "items": { "$ref": "#/components/schemas/SignInLog" } }, "count": { "type": "integer", "description": "Total number of logs matching the query" } } } } } } } }, "delete": { "summary": "Delete Sign-in logs before a certain date, this action is irreversible", "description": "Required scope - root", "tags": [ "Logs" ], "parameters": [ { "in": "query", "name": "before", "schema": { "type": "string" }, "description": "Delete all logs that are older than this date in utc format." } ], "responses": { "204": { "description": "Successful operation with no content to return" } } } }, "/api/v1/logs/sign-in/{id}": { "get": { "summary": "Get an sign-in log by id", "description": "Required scope - root", "tags": [ "Logs" ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "number" }, "description": "The unique ID of the sign-in log" } ], "responses": { "200": { "description": "A single sign-in log object", "content": { "application/json": { "schema": { "type": "object", "properties": { "log": { "$ref": "#/components/schemas/SignInLog" } } } } } } } } } }, "tags": [] }