{"openapi":"3.1.1","info":{"title":"Better Auth","description":"API Reference for your Better Auth Instance","version":"1.1.0"},"components":{"schemas":{"User":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"email":{"type":"string"},"emailVerified":{"type":"boolean","default":false,"readOnly":true},"image":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"username":{"type":"string"},"displayUsername":{"type":"string"},"twoFactorEnabled":{"type":"boolean","default":false,"readOnly":true},"role":{"type":"string","readOnly":true},"banned":{"type":"boolean","default":false,"readOnly":true},"banReason":{"type":"string","readOnly":true},"banExpires":{"type":"string","format":"date-time","readOnly":true},"lastLoginMethod":{"type":"string","readOnly":true},"phoneNumber":{"type":"string"},"metadata":{"type":"json"},"emailOtpEnabled":{"type":"boolean","default":false,"readOnly":true}},"required":["id","name","email","emailVerified","createdAt","updatedAt"]},"Session":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"expiresAt":{"type":"string","format":"date-time"},"token":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"ipAddress":{"type":"string"},"userAgent":{"type":"string"},"userId":{"type":"string"},"impersonatedBy":{"type":"string","readOnly":true},"activeOrganizationId":{"type":"string","readOnly":true},"activeTeamId":{"type":"string","readOnly":true}},"required":["id","expiresAt","token","createdAt","updatedAt","userId"]},"Account":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"accountId":{"type":"string"},"providerId":{"type":"string"},"userId":{"type":"string"},"accessToken":{"type":"string"},"refreshToken":{"type":"string"},"idToken":{"type":"string"},"accessTokenExpiresAt":{"type":"string","format":"date-time"},"refreshTokenExpiresAt":{"type":"string","format":"date-time"},"scope":{"type":"string"},"password":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","accountId","providerId","userId","createdAt","updatedAt"]},"Verification":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"identifier":{"type":"string"},"value":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","identifier","value","expiresAt","createdAt","updatedAt"]},"Passkey":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"publicKey":{"type":"string"},"userId":{"type":"string"},"credentialID":{"type":"string"},"counter":{"type":"number"},"deviceType":{"type":"string"},"backedUp":{"type":"boolean"},"transports":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"aaguid":{"type":"string"}},"required":["id","publicKey","userId","credentialID","counter","deviceType","backedUp"]},"TwoFactor":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"secret":{"type":"string"},"backupCodes":{"type":"string"},"userId":{"type":"string"},"verified":{"type":"boolean","default":true,"readOnly":true},"failedVerificationCount":{"type":"number","default":0,"readOnly":true},"lockedUntil":{"type":"string","format":"date-time","readOnly":true}},"required":["id"]},"Organization":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"slug":{"type":"string"},"logo":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"metadata":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"isArchived":{"type":"boolean"},"archivedAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","createdAt"]},"OrganizationRole":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"organizationId":{"type":"string"},"role":{"type":"string"},"permission":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"type":{"type":"string","readOnly":true}},"required":["id","organizationId","role","permission","createdAt"]},"Team":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"memberCount":{"type":"number","default":0,"readOnly":true},"organizationId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"status":{"type":"string"}},"required":["id","name","organizationId","createdAt","status"]},"TeamMember":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"teamId":{"type":"string"},"userId":{"type":"string"},"membershipKey":{"type":"string","readOnly":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","teamId","userId"]},"Member":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"organizationId":{"type":"string"},"userId":{"type":"string"},"role":{"type":"string","default":"member"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"banned":{"type":"boolean"},"bannedAt":{"type":"string","format":"date-time"}},"required":["id","organizationId","userId","role","createdAt"]},"Invitation":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"organizationId":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"},"teamId":{"type":"string"},"status":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"inviterId":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"source":{"type":"string"},"oauthScopes":{"type":"array","items":{"type":"string"}},"oauthRedirectUri":{"type":"string"}},"required":["id","organizationId","email","status","expiresAt","createdAt","inviterId"]},"PermissionApplication":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"planes":{"type":"array","items":{"type":"string"}},"status":{"type":["active","pending","archived"],"default":"pending"},"isSystem":{"type":"boolean","default":false},"catalogVersion":{"type":"number","default":0},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"clientId":{"type":"string"},"resourceId":{"type":"string"}},"required":["id","slug","name","planes","status","isSystem","catalogVersion","createdAt","updatedAt"]},"PermissionDefinition":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"applicationId":{"type":"string"},"plane":{"type":["admin","organization"]},"key":{"type":"string"},"resource":{"type":"string"},"action":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"status":{"type":["active","archived"],"default":"active"},"enforcement":{"type":["inherit","shadow","enforce"],"default":"inherit"},"isDangerous":{"type":"boolean","default":false},"deprecatedAt":{"type":"string","format":"date-time"},"replacedByKey":{"type":"string"},"sortOrder":{"type":"number","default":0},"legacyResource":{"type":"string"},"legacyAction":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","applicationId","plane","key","resource","action","name","status","enforcement","isDangerous","sortOrder","createdAt","updatedAt"]},"AdminRole":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"key":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"rank":{"type":"number"},"type":{"type":["system","custom"],"default":"custom"},"isSuperuser":{"type":"boolean","default":false},"isDefault":{"type":"boolean","default":false},"isAssignable":{"type":"boolean","default":true},"status":{"type":["inactive","active","archived"],"default":"active"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","key","name","rank","type","isSuperuser","isDefault","isAssignable","status","createdAt","updatedAt"]},"AdminRolePermission":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"roleId":{"type":"string"},"permissionId":{"type":"string"},"effect":{"type":["allow","deny"],"default":"allow"},"conditions":{"type":"json"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","roleId","permissionId","effect","createdAt"]},"AdminRoleAssignment":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"userId":{"type":"string"},"roleId":{"type":"string"},"grantedByUserId":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","userId","roleId","createdAt"]},"OrganizationSystemRole":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"key":{"type":"string"},"displayName":{"type":"string"},"description":{"type":"string"},"rank":{"type":"number","default":0},"status":{"type":["inactive","active","archived"],"default":"inactive"},"publishedAt":{"type":"string","format":"date-time"},"archivedAt":{"type":"string","format":"date-time"},"createdByUserId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","key","displayName","rank","status","createdAt","updatedAt"]},"OrganizationSystemRolePermission":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"systemRoleId":{"type":"string"},"permissionId":{"type":"string"},"effect":{"type":["allow","deny"],"default":"allow"},"conditions":{"type":"json"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","systemRoleId","permissionId","effect","createdAt"]},"OrganizationRoleDetail":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"organizationRoleId":{"type":"string"},"organizationId":{"type":"string"},"displayName":{"type":"string"},"description":{"type":"string"},"systemRoleId":{"type":"string"},"rank":{"type":"number","default":0},"status":{"type":["active","archived"],"default":"active"},"archivedAt":{"type":"string","format":"date-time"},"createdByUserId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","organizationRoleId","organizationId","displayName","rank","status","createdAt","updatedAt"]},"OrganizationRolePermission":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"organizationRoleId":{"type":"string"},"organizationId":{"type":"string"},"permissionId":{"type":"string"},"effect":{"type":["allow","deny"],"default":"allow"},"conditions":{"type":"json"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","organizationRoleId","organizationId","permissionId","effect","createdAt"]},"OrganizationMemberRoleAssignment":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"memberId":{"type":"string"},"organizationId":{"type":"string"},"organizationRoleId":{"type":"string"},"grantedByUserId":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","memberId","organizationId","organizationRoleId","createdAt"]},"PermissionRegistryState":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"catalogVersion":{"type":"number","default":0},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","catalogVersion","updatedAt"]},"PermissionAuditEvent":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"occurredAt":{"type":"string","format":"date-time"},"actorUserId":{"type":"string"},"actorType":{"type":["user","client","system"]},"actorClientId":{"type":"string"},"action":{"type":"string"},"plane":{"type":["admin","organization"]},"organizationId":{"type":"string"},"targetType":{"type":"string"},"targetId":{"type":"string"},"before":{"type":"json"},"after":{"type":"json"},"reason":{"type":"string"},"requestId":{"type":"string"},"ipAddress":{"type":"string"},"userAgent":{"type":"string"}},"required":["id","occurredAt","actorType","action","targetType","targetId"]},"Apikey":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"configId":{"type":"string","default":"default","readOnly":true},"name":{"type":"string","readOnly":true},"start":{"type":"string","readOnly":true},"referenceId":{"type":"string","readOnly":true},"prefix":{"type":"string","readOnly":true},"key":{"type":"string","readOnly":true},"refillInterval":{"type":"number","readOnly":true},"refillAmount":{"type":"number","readOnly":true},"lastRefillAt":{"type":"string","format":"date-time","readOnly":true},"enabled":{"type":"boolean","default":true,"readOnly":true},"rateLimitEnabled":{"type":"boolean","default":true,"readOnly":true},"rateLimitTimeWindow":{"type":"number","default":86400000,"readOnly":true},"rateLimitMax":{"type":"number","default":10,"readOnly":true},"requestCount":{"type":"number","default":0,"readOnly":true},"remaining":{"type":"number","readOnly":true},"lastRequest":{"type":"string","format":"date-time","readOnly":true},"expiresAt":{"type":"string","format":"date-time","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"permissions":{"type":"string","readOnly":true},"metadata":{"type":"string"}},"required":["id","configId","referenceId","key","createdAt","updatedAt"]},"Jwks":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"publicKey":{"type":"string"},"privateKey":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"alg":{"type":"string"},"crv":{"type":"string"}},"required":["id","publicKey","privateKey","createdAt"]},"OauthClient":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"clientId":{"type":"string"},"clientSecret":{"type":"string"},"clientDiscoveryId":{"type":"string"},"disabled":{"type":"boolean","default":false},"skipConsent":{"type":"boolean"},"enableEndSession":{"type":"boolean"},"subjectType":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"clientCredentialsScopes":{"type":"array","items":{"type":"string"},"default":[]},"userId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"name":{"type":"string"},"uri":{"type":"string"},"icon":{"type":"string"},"contacts":{"type":"array","items":{"type":"string"}},"tos":{"type":"string"},"policy":{"type":"string"},"softwareId":{"type":"string"},"softwareVersion":{"type":"string"},"softwareStatement":{"type":"string"},"redirectUris":{"type":"array","items":{"type":"string"}},"postLogoutRedirectUris":{"type":"array","items":{"type":"string"}},"backchannelLogoutUri":{"type":"string"},"backchannelLogoutSessionRequired":{"type":"boolean"},"tokenEndpointAuthMethod":{"type":"string"},"applicationType":{"type":"string"},"jwks":{"type":"string"},"jwksUri":{"type":"string"},"grantTypes":{"type":"array","items":{"type":"string"}},"responseTypes":{"type":"array","items":{"type":"string"}},"requirePKCE":{"type":"boolean"},"dpopBoundAccessTokens":{"type":"boolean","default":false},"referenceId":{"type":"string"},"metadata":{"type":"json"}},"required":["id","clientId","redirectUris"]},"OauthResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"identifier":{"type":"string"},"name":{"type":"string"},"accessTokenTtl":{"type":"number"},"refreshTokenTtl":{"type":"number"},"signingAlgorithm":{"type":"string"},"signingKeyId":{"type":"string"},"allowedScopes":{"type":"array","items":{"type":"string"}},"customClaims":{"type":"json"},"dpopBoundAccessTokensRequired":{"type":"boolean","default":false},"disabled":{"type":"boolean","default":false},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"policyVersion":{"type":"number","default":1},"metadata":{"type":"json"}},"required":["id","identifier","name"]},"OauthClientResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"clientId":{"type":"string"},"resourceId":{"type":"string"},"metadata":{"type":"json"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","clientId","resourceId"]},"OauthRefreshToken":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"token":{"type":"string"},"clientId":{"type":"string"},"sessionId":{"type":"string"},"userId":{"type":"string"},"referenceId":{"type":"string"},"authorizationCodeId":{"type":"string"},"resources":{"type":"array","items":{"type":"string"}},"requestedUserInfoClaims":{"type":"array","items":{"type":"string"}},"expiresAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"revoked":{"type":"string","format":"date-time"},"rotatedAt":{"type":"string","format":"date-time"},"rotationReplayResponse":{"type":"string"},"rotationReplayExpiresAt":{"type":"string","format":"date-time"},"authTime":{"type":"string","format":"date-time"},"confirmation":{"type":"json"},"scopes":{"type":"array","items":{"type":"string"}}},"required":["id","token","clientId","userId","scopes"]},"OauthAccessToken":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"token":{"type":"string"},"clientId":{"type":"string"},"sessionId":{"type":"string"},"userId":{"type":"string"},"referenceId":{"type":"string"},"authorizationCodeId":{"type":"string"},"resources":{"type":"array","items":{"type":"string"}},"requestedUserInfoClaims":{"type":"array","items":{"type":"string"}},"refreshId":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"revoked":{"type":"string","format":"date-time"},"confirmation":{"type":"json"},"scopes":{"type":"array","items":{"type":"string"}}},"required":["id","clientId","scopes"]},"OauthConsent":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"clientId":{"type":"string"},"userId":{"type":"string"},"referenceId":{"type":"string"},"resources":{"type":"array","items":{"type":"string"}},"requestedUserInfoClaims":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","clientId","scopes"]},"OauthClientAssertion":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"expiresAt":{"type":"string","format":"date-time"}},"required":["id","expiresAt"]},"Invite":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"token":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"maxUses":{"type":"number"},"infinityMaxUses":{"type":"boolean","default":false},"createdByUserId":{"type":"string"},"redirectToAfterUpgrade":{"type":"string"},"shareInviterName":{"type":"boolean"},"email":{"type":"string"},"emails":{"type":"array","items":{"type":"string"}},"role":{"type":"string"},"newAccount":{"type":"boolean"},"status":{"type":["pending","rejected","canceled","used"]}},"required":["id","expiresAt","maxUses","infinityMaxUses","shareInviterName","role","status"]},"InviteUse":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"inviteId":{"type":"string"},"usedAt":{"type":"string","format":"date-time"},"usedByUserId":{"type":"string"}},"required":["id","inviteId","usedAt"]}},"securitySchemes":{"apiKeyCookie":{"type":"apiKey","in":"cookie","name":"apiKeyCookie","description":"API Key authentication via cookie"},"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token authentication"}}},"security":[{"apiKeyCookie":[],"bearerAuth":[]}],"servers":[{"url":"https://dev.auth.graphxserver.io/api/auth"}],"tags":[{"name":"Default","description":"Default endpoints that are included with Better Auth by default. These endpoints are not part of any plugin."}],"paths":{"/sign-in/social":{"post":{"tags":["Default"],"description":"Sign in with a social provider","operationId":"socialSignIn","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"callbackURL":{"type":"string","description":"Callback URL to redirect to after the user has signed in"},"newUserCallbackURL":{"type":"string"},"errorCallbackURL":{"type":"string","description":"Callback URL to redirect to if an error happens"},"provider":{"anyOf":[{"type":"string","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"}]},"disableRedirect":{"type":"boolean","description":"Disable automatic redirection to the provider. Useful for handling the redirection yourself"},"idToken":{"type":"object","properties":{"token":{"type":"string","description":"ID token from the provider"},"nonce":{"type":"string","description":"Nonce used to generate the token"},"accessToken":{"type":"string","description":"Access token from the provider"},"refreshToken":{"type":"string","description":"Refresh token from the provider"},"expiresAt":{"type":"number","description":"Expiry date of the token"},"user":{"type":"object","properties":{"name":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"}}},"email":{"type":"string"}},"description":"The user object from the provider. Only available for some providers like Apple."}},"required":["token"]},"scopes":{"type":"array","items":{"type":"string"},"description":"Array of scopes to request from the provider. This will override the default scopes passed."},"requestSignUp":{"type":"boolean","description":"Explicitly request sign-up. Useful when disableImplicitSignUp is true for this provider"},"loginHint":{"type":"string","description":"The login hint to use for the authorization code request"},"additionalParams":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Extra query parameters to append to the provider authorization URL (e.g. Cognito identity_provider, Google hd)."},"additionalData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["provider"]}}}},"responses":{"200":{"description":"Success - Returns session details (idToken branch) or an authorize URL (redirect branch)","content":{"application/json":{"schema":{"type":"object","description":"Returns session details when idToken is provided, or an authorize URL otherwise","properties":{"token":{"type":"string"},"user":{"type":"object","$ref":"#/components/schemas/User"},"url":{"type":"string"},"redirect":{"type":"boolean"}},"required":["redirect"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/callback/{id}":{"get":{"tags":["Default"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}},"post":{"tags":["Default"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"error":{"type":"string"},"device_id":{"type":"string"},"error_description":{"type":"string"},"state":{"type":"string"},"user":{"type":"string"},"iss":{"type":"string"}}}}}},"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/get-session":{"get":{"tags":["Default"],"description":"Get the current session","operationId":"getSession","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":["object","null"],"properties":{"session":{"$ref":"#/components/schemas/Session"},"user":{"$ref":"#/components/schemas/User"}},"required":["session","user"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}},"post":{"tags":["Default"],"description":"Get the current session","operationId":"getSessionPost","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":["object","null"],"properties":{"session":{"$ref":"#/components/schemas/Session"},"user":{"$ref":"#/components/schemas/User"}},"required":["session","user"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/sign-out":{"post":{"tags":["Default"],"description":"Sign out the current user","operationId":"signOut","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"callbackURL":{"type":"string","description":"The URL to redirect to after provider logout"},"disableRedirect":{"type":"boolean","description":"Return the provider logout URL without redirecting"},"state":{"type":"string","description":"State to pass to the provider logout endpoint"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"url":{"type":"string","description":"Provider logout URL when RP-initiated logout is available"},"redirect":{"type":"boolean","description":"Whether the client should redirect to the provider logout URL"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/sign-up/email":{"post":{"tags":["Default"],"description":"Sign up a user using email and password","operationId":"signUpWithEmailAndPassword","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the user"},"email":{"type":"string","description":"The email of the user"},"password":{"type":"string","description":"The password of the user"},"image":{"type":"string","description":"The profile image URL of the user"},"callbackURL":{"type":"string","description":"The URL to use for email verification callback"},"rememberMe":{"type":"boolean","description":"If this is false, the session will not be remembered. Default is `true`."},"phoneNumber":{"type":"string"},"metadata":{},"username":{"type":"string"},"displayUsername":{"type":"string"}},"required":["name","email","password"]}}}},"responses":{"200":{"description":"Successfully created user","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","nullable":true,"description":"Authentication token for the session"},"user":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the user"},"email":{"type":"string","format":"email","description":"The email address of the user"},"name":{"type":"string","description":"The name of the user"},"image":{"type":"string","format":"uri","nullable":true,"description":"The profile image URL of the user"},"emailVerified":{"type":"boolean","description":"Whether the email has been verified"},"createdAt":{"type":"string","format":"date-time","description":"When the user was created"},"updatedAt":{"type":"string","format":"date-time","description":"When the user was last updated"}},"required":["id","email","name","emailVerified","createdAt","updatedAt"]}},"required":["user"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"422":{"description":"Unprocessable Entity. User already exists or failed to create user.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/sign-in/email":{"post":{"tags":["Default"],"description":"Sign in with email and password","operationId":"signInEmail","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Email of the user"},"password":{"type":"string","description":"Password of the user"},"callbackURL":{"type":"string","description":"Callback URL to use as a redirect for email verification"},"rememberMe":{"type":"boolean","description":"If this is false, the session will not be remembered. Default is `true`."}},"required":["email","password"]}}}},"responses":{"200":{"description":"Success - Returns either session details or redirect URL","content":{"application/json":{"schema":{"type":"object","description":"Session response when idToken is provided","properties":{"redirect":{"type":"boolean","enum":[false]},"token":{"type":"string","description":"Session token"},"url":{"type":"string","nullable":true},"user":{"type":"object","$ref":"#/components/schemas/User"}},"required":["redirect","token","user"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/reset-password":{"post":{"tags":["Default"],"description":"Reset the password for a user","operationId":"resetPassword","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"newPassword":{"type":"string","description":"The new password to set"},"token":{"type":"string","description":"The token to reset the password"}},"required":["newPassword"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/verify-password":{"post":{"tags":["Default"],"description":"Verify the current user's password","operationId":"verifyPassword","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","description":"The password to verify"}},"required":["password"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/verify-email":{"get":{"tags":["Default"],"description":"Verify the email of the user","security":[{"bearerAuth":[]}],"parameters":[{"name":"token","in":"query","description":"The token to verify the email","required":true,"schema":{"type":"string"}},{"name":"callbackURL","in":"query","description":"The URL to redirect to after email verification","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","$ref":"#/components/schemas/User"},"status":{"type":"boolean","description":"Indicates if the email was verified successfully"}},"required":["user","status"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/send-verification-email":{"post":{"tags":["Default"],"description":"Send a verification email to the user","operationId":"sendVerificationEmail","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"The email to send the verification email to","example":"user@example.com"},"callbackURL":{"type":"string","description":"The URL to use for email verification callback","example":"https://example.com/callback","nullable":true}},"required":["email"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","description":"Indicates if the email was sent successfully","example":true}}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message","example":"Verification email isn't enabled"}}}}}},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/change-email":{"post":{"tags":["Default"],"operationId":"changeEmail","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"newEmail":{"type":"string","description":"The new email address to set must be a valid email address"},"callbackURL":{"type":"string","description":"The URL to redirect to after email verification"}},"required":["newEmail"]}}}},"responses":{"200":{"description":"Email change request processed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","$ref":"#/components/schemas/User"},"status":{"type":"boolean","description":"Indicates if the request was successful"},"message":{"type":"string","enum":["Email updated","Verification email sent"],"description":"Status message of the email change process","nullable":true}},"required":["status"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/change-password":{"post":{"tags":["Default"],"description":"Change the password of the user","operationId":"changePassword","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"newPassword":{"type":"string","description":"The new password to set"},"currentPassword":{"type":"string","description":"The current password is required"},"revokeOtherSessions":{"type":"boolean","description":"Must be a boolean value"}},"required":["newPassword","currentPassword"]}}}},"responses":{"200":{"description":"Password successfully changed","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","nullable":true,"description":"New session token if other sessions were revoked"},"user":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the user"},"email":{"type":"string","format":"email","description":"The email address of the user"},"name":{"type":"string","description":"The name of the user"},"image":{"type":"string","format":"uri","nullable":true,"description":"The profile image URL of the user"},"emailVerified":{"type":"boolean","description":"Whether the email has been verified"},"createdAt":{"type":"string","format":"date-time","description":"When the user was created"},"updatedAt":{"type":"string","format":"date-time","description":"When the user was last updated"}},"required":["id","email","name","emailVerified","createdAt","updatedAt"]}},"required":["user"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/update-session":{"post":{"tags":["Default"],"description":"Update the current session","operationId":"updateSession","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string","description":"Field name must be a string"},"additionalProperties":{}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"session":{"type":"object","$ref":"#/components/schemas/Session"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/update-user":{"post":{"tags":["Default"],"description":"Update the current user","operationId":"updateUser","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the user"},"image":{"type":"string","description":"The image of the user","nullable":true},"phoneNumber":{"type":"string"},"metadata":{},"username":{"type":"string"},"displayUsername":{"type":"string"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","$ref":"#/components/schemas/User"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/delete-user":{"post":{"tags":["Default"],"description":"Delete the user","operationId":"deleteUser","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"callbackURL":{"type":"string","description":"The callback URL to redirect to after the user is deleted"},"password":{"type":"string","description":"The user's password. Required if session is not fresh"},"token":{"type":"string","description":"The deletion verification token"}}}}}},"responses":{"200":{"description":"User deletion processed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates if the operation was successful"},"message":{"type":"string","enum":["User deleted","Verification email sent"],"description":"Status message of the deletion process"}},"required":["success","message"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/request-password-reset":{"post":{"tags":["Default"],"description":"Send a password reset email to the user","operationId":"requestPasswordReset","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"The email address of the user to send a password reset email to"},"redirectTo":{"type":"string","description":"The URL to redirect the user to reset their password. If the token isn't valid or expired, it'll be redirected with a query parameter `?error=INVALID_TOKEN`. If the token is valid, it'll be redirected with a query parameter `?token=VALID_TOKEN"}},"required":["email"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/reset-password/{token}":{"get":{"tags":["Default"],"description":"Redirects the user to the callback URL with the token","operationId":"resetPasswordCallback","security":[{"bearerAuth":[]}],"parameters":[{"name":"token","in":"path","required":true,"description":"The token to reset the password","schema":{"type":"string"}},{"name":"callbackURL","in":"query","required":true,"description":"The URL to redirect the user to reset their password","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/list-sessions":{"get":{"tags":["Default"],"description":"List all active sessions for the user","operationId":"listUserSessions","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Session"}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/revoke-session":{"post":{"tags":["Default"],"description":"Revoke a single session","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"The token to revoke"}},"required":["token"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","description":"Indicates if the session was revoked successfully"}},"required":["status"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/revoke-sessions":{"post":{"tags":["Default"],"description":"Revoke all sessions for the user","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","description":"Indicates if all sessions were revoked successfully"}},"required":["status"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/revoke-other-sessions":{"post":{"tags":["Default"],"description":"Revoke all other sessions for the user except the current one","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","description":"Indicates if all other sessions were revoked successfully"}},"required":["status"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/link-social":{"post":{"tags":["Default"],"description":"Link a social account to the user","operationId":"linkSocialAccount","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"callbackURL":{"type":"string","description":"The URL to redirect to after the user has signed in"},"provider":{"anyOf":[{"type":"string","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"}]},"idToken":{"type":"object","properties":{"token":{"type":"string"},"nonce":{"type":"string"},"accessToken":{"type":"string"},"refreshToken":{"type":"string"}},"required":["token"]},"requestSignUp":{"type":"boolean"},"scopes":{"type":"array","items":{"type":"string"},"description":"Additional scopes to request from the provider"},"errorCallbackURL":{"type":"string","description":"The URL to redirect to if there is an error during the link process"},"disableRedirect":{"type":"boolean","description":"Disable automatic redirection to the provider. Useful for handling the redirection yourself"},"loginHint":{"type":"string","description":"The login hint to use for the authorization code request"},"additionalParams":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Extra query parameters to append to the provider authorization URL (e.g. Cognito identity_provider, Google hd)."},"additionalData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["provider"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"The authorization URL to redirect the user to"},"redirect":{"type":"boolean","description":"Indicates if the user should be redirected to the authorization URL"},"status":{"type":"boolean"}},"required":["redirect"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/list-accounts":{"get":{"tags":["Default"],"description":"List all accounts linked to the user","operationId":"listUserAccounts","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"providerId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"accountId":{"type":"string"},"userId":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}}},"required":["id","providerId","createdAt","updatedAt","accountId","userId","scopes"]}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/delete-user/callback":{"get":{"tags":["Default"],"description":"Callback to complete user deletion with verification token","security":[{"bearerAuth":[]}],"parameters":[{"name":"token","in":"query","schema":{"type":"string","description":"The token to verify the deletion request"}},{"name":"callbackURL","in":"query","schema":{"type":"string","description":"The URL to redirect to after deletion"}}],"responses":{"200":{"description":"User successfully deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates if the deletion was successful"},"message":{"type":"string","enum":["User deleted"],"description":"Confirmation message"}},"required":["success","message"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/unlink-account":{"post":{"tags":["Default"],"description":"Unlink an account","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","description":"The Better Auth account ID to unlink"}},"required":["accountId"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/refresh-token":{"post":{"tags":["Default"],"description":"Refresh the access token using a refresh token","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"accountId":{"type":"string","description":"The Better Auth account ID"},"userId":{"type":"string","description":"The user ID associated with the account"}},"required":["accountId"]},{"type":"object","properties":{"useAccountCookie":{"enum":[true],"description":"Select the current OAuth account from its signed cookie"},"userId":{"type":"string","description":"The user ID associated with the account"}},"required":["useAccountCookie"]}]}}}},"responses":{"200":{"description":"Access token refreshed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"tokenType":{"type":"string"},"idToken":{"type":"string"},"accessToken":{"type":"string"},"refreshToken":{"type":"string"},"accessTokenExpiresAt":{"type":"string","format":"date-time"},"refreshTokenExpiresAt":{"type":"string","format":"date-time"}}}}}},"400":{"description":"Invalid refresh token or provider configuration"},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/get-access-token":{"post":{"tags":["Default"],"description":"Get a valid access token, doing a refresh if needed","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"accountId":{"type":"string","description":"The Better Auth account ID"},"userId":{"type":"string","description":"The user ID associated with the account"}},"required":["accountId"]},{"type":"object","properties":{"useAccountCookie":{"enum":[true],"description":"Select the current OAuth account from its signed cookie"},"userId":{"type":"string","description":"The user ID associated with the account"}},"required":["useAccountCookie"]}]}}}},"responses":{"200":{"description":"A Valid access token","content":{"application/json":{"schema":{"type":"object","properties":{"tokenType":{"type":"string"},"idToken":{"type":"string"},"accessToken":{"type":"string"},"accessTokenExpiresAt":{"type":"string","format":"date-time"}}}}}},"400":{"description":"Invalid refresh token or provider configuration"},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/account-info":{"get":{"tags":["Default"],"description":"Get the account info provided by the provider","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true},"image":{"type":"string"},"emailVerified":{"type":"boolean"}},"required":["emailVerified"]},"account":{"type":"object","properties":{"id":{"type":"string"},"providerId":{"type":"string"},"accountId":{"type":"string"}},"required":["id","providerId","accountId"],"additionalProperties":false},"data":{"type":"object","properties":{},"additionalProperties":true}},"required":["user","data","account"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/ok":{"get":{"tags":["Default"],"description":"Check if the API is working","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"API is working","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","description":"Indicates if the API is working"}},"required":["ok"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/error":{"get":{"tags":["Default"],"description":"Displays an error page","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"text/html":{"schema":{"type":"string","description":"The HTML content of the error page"}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth-proxy-callback":{"get":{"tags":["Oauth-proxy"],"description":"OAuth Proxy Callback","operationId":"oauthProxyCallback","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"callbackURL","required":true,"description":"The URL to redirect to after the proxy"},{"in":"query","name":"profile","required":false,"description":"Encrypted OAuth profile data"}],"responses":{"302":{"description":"Redirect","headers":{"Location":{"description":"The URL to redirect to","schema":{"type":"string"}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/callback/{id}/oauth-proxy":{"get":{"tags":["Oauth-proxy"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"callbackURL","in":"query","schema":{"type":"string","description":"The URL to redirect to after the proxy"}},{"name":"profile","in":"query","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/multi-session/list-device-sessions":{"get":{"tags":["Multi-session"],"security":[{"bearerAuth":[]}],"parameters":[],"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/multi-session/set-active":{"post":{"tags":["Multi-session"],"description":"Set the active session","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sessionToken":{"type":"string","description":"The session token to set as active"}},"required":["sessionToken"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"session":{"$ref":"#/components/schemas/Session"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/multi-session/revoke":{"post":{"tags":["Multi-session"],"description":"Revoke a device session","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sessionToken":{"type":"string","description":"The session token to revoke"}},"required":["sessionToken"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/passkey/generate-register-options":{"get":{"tags":["Passkey"],"description":"Generate registration options for a new passkey","operationId":"generatePasskeyRegistrationOptions","security":[{"bearerAuth":[]}],"parameters":[{"name":"authenticatorAttachment","in":"query","required":false,"description":"Type of authenticator to use for registration.\n                          \"platform\" for device-specific authenticators,\n                          \"cross-platform\" for authenticators that can be used across devices.","schema":{"type":"string","enum":["platform","cross-platform"]}},{"name":"name","in":"query","required":false,"description":"Optional custom name for the passkey.\n                          This can help identify the passkey when managing multiple credentials.","schema":{"type":"string"}},{"name":"context","in":"query","required":false,"description":"Optional context for passkey-first registration flows.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"challenge":{"type":"string"},"rp":{"type":"object","properties":{"name":{"type":"string"},"id":{"type":"string"}}},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"displayName":{"type":"string"}}},"pubKeyCredParams":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"alg":{"type":"number"}}}},"timeout":{"type":"number"},"excludeCredentials":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"transports":{"type":"array","items":{"type":"string"}}}}},"authenticatorSelection":{"type":"object","properties":{"authenticatorAttachment":{"type":"string"},"requireResidentKey":{"type":"boolean"},"userVerification":{"type":"string"}}},"attestation":{"type":"string"},"extensions":{"type":"object"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/passkey/generate-authenticate-options":{"get":{"tags":["Passkey"],"description":"Generate authentication options for a passkey","operationId":"passkeyGenerateAuthenticateOptions","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"challenge":{"type":"string"},"rp":{"type":"object","properties":{"name":{"type":"string"},"id":{"type":"string"}}},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"displayName":{"type":"string"}}},"timeout":{"type":"number"},"allowCredentials":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"transports":{"type":"array","items":{"type":"string"}}}}},"userVerification":{"type":"string"},"authenticatorSelection":{"type":"object","properties":{"authenticatorAttachment":{"type":"string"},"requireResidentKey":{"type":"boolean"},"userVerification":{"type":"string"}}},"extensions":{"type":"object"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/passkey/verify-registration":{"post":{"tags":["Passkey"],"description":"Verify registration of a new passkey","operationId":"passkeyVerifyRegistration","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"response":{},"name":{"type":"string","description":"Name of the passkey"},"createSession":{"type":"boolean","description":"Create a session after registering the passkey"}},"required":["response"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","allOf":[{"$ref":"#/components/schemas/Passkey"},{"type":"object","properties":{"session":{"$ref":"#/components/schemas/Session"},"user":{"$ref":"#/components/schemas/User"}}}]}}}},"400":{"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/passkey/verify-authentication":{"post":{"tags":["Passkey"],"description":"Verify authentication of a passkey","operationId":"passkeyVerifyAuthentication","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"response":{"type":"object","propertyNames":{},"additionalProperties":{}}},"required":["response"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"session":{"$ref":"#/components/schemas/Session"},"user":{"$ref":"#/components/schemas/User"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/passkey/list-user-passkeys":{"get":{"tags":["Passkey"],"description":"List all passkeys for the authenticated user","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Passkeys retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Passkey","required":["id","userId","publicKey","createdAt","updatedAt"]},"description":"Array of passkey objects associated with the user"}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/passkey/delete-passkey":{"post":{"tags":["Passkey"],"description":"Delete a specific passkey","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the passkey to delete. Eg: \"some-passkey-id\""}},"required":["id"]}}}},"responses":{"200":{"description":"Passkey deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","description":"Indicates whether the deletion was successful"}},"required":["status"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/passkey/update-passkey":{"post":{"tags":["Passkey"],"description":"Update a specific passkey's name","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the passkey which will be updated. Eg: \"passkey-id\""},"name":{"type":"string","minLength":1,"description":"The new name which the passkey will be updated to. Eg: \"my-new-passkey-name\""}},"required":["id","name"]}}}},"responses":{"200":{"description":"Passkey updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"passkey":{"$ref":"#/components/schemas/Passkey"}},"required":["passkey"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/sign-in/username":{"post":{"tags":["Username"],"description":"Sign in with username","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","description":"The username of the user"},"password":{"type":"string","description":"The password of the user"},"rememberMe":{"type":"boolean","description":"Remember the user session"},"callbackURL":{"type":"string","description":"URL to redirect to after sign in (also used as the redirect target for email verification when required)"}},"required":["username","password"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"redirect":{"type":"boolean","description":"Whether the client should follow the Location header. True when callbackURL was provided."},"token":{"type":"string","description":"Session token for the authenticated session"},"url":{"type":"string","nullable":true,"description":"The callbackURL echoed back so the client can redirect."},"user":{"$ref":"#/components/schemas/User"}},"required":["redirect","token","user"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"422":{"description":"Unprocessable Entity. Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/is-username-available":{"post":{"tags":["Username"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","description":"The username to check"}},"required":["username"]}}}},"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/two-factor/get-totp-uri":{"post":{"tags":["Two-factor"],"description":"Use this endpoint to get the TOTP URI","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","description":"User password"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"totpURI":{"type":"string"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/two-factor/verify-totp":{"post":{"tags":["Two-factor"],"description":"Verify two factor TOTP","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The otp code to verify. Eg: \"012345\""},"trustDevice":{"type":"boolean","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"}},"required":["code"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/two-factor/send-otp":{"post":{"tags":["Two-factor"],"description":"Send two factor OTP to the user","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"trustDevice":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/two-factor/verify-otp":{"post":{"tags":["Two-factor"],"description":"Verify two factor OTP","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The otp code to verify. Eg: \"012345\""},"trustDevice":{"type":"boolean"}},"required":["code"]}}}},"responses":{"200":{"description":"Two-factor OTP verified successfully","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"Session token for the authenticated session"},"user":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the user"},"email":{"type":"string","format":"email","nullable":true,"description":"User's email address"},"emailVerified":{"type":"boolean","nullable":true,"description":"Whether the email is verified"},"name":{"type":"string","nullable":true,"description":"User's name"},"image":{"type":"string","format":"uri","nullable":true,"description":"User's profile image URL"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the user was created"},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the user was last updated"}},"required":["id","createdAt","updatedAt"],"description":"The authenticated user object"}},"required":["token","user"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/two-factor/verify-backup-code":{"post":{"tags":["Two-factor"],"description":"Verify a backup code for two-factor authentication","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"A backup code to verify. Eg: \"123456\""},"disableSession":{"type":"boolean","description":"If true, the session cookie will not be set."},"trustDevice":{"type":"boolean","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"}},"required":["code"]}}}},"responses":{"200":{"description":"Backup code verified successfully","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the user"},"email":{"type":"string","format":"email","nullable":true,"description":"User's email address"},"emailVerified":{"type":"boolean","nullable":true,"description":"Whether the email is verified"},"name":{"type":"string","nullable":true,"description":"User's name"},"image":{"type":"string","format":"uri","nullable":true,"description":"User's profile image URL"},"twoFactorEnabled":{"type":"boolean","description":"Whether two-factor authentication is enabled for the user"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the user was created"},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the user was last updated"}},"required":["id","twoFactorEnabled","createdAt","updatedAt"],"description":"The authenticated user object with two-factor details"},"session":{"type":"object","properties":{"token":{"type":"string","description":"Session token"},"userId":{"type":"string","description":"ID of the user associated with the session"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the session was created"},"expiresAt":{"type":"string","format":"date-time","description":"Timestamp when the session expires"}},"required":["token","userId","createdAt","expiresAt"],"description":"The current session object, included unless disableSession is true"}},"required":["user","session"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/two-factor/generate-backup-codes":{"post":{"tags":["Two-factor"],"description":"Generate new backup codes for two-factor authentication","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","description":"The users password."}}}}}},"responses":{"200":{"description":"Backup codes generated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","description":"Indicates if the backup codes were generated successfully","enum":[true]},"backupCodes":{"type":"array","items":{"type":"string"},"description":"Array of generated backup codes in plain text"}},"required":["status","backupCodes"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/two-factor/enable":{"post":{"tags":["Two-factor"],"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.","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","description":"User password"},"method":{"type":"string","enum":["otp","totp"]},"issuer":{"type":"string","description":"Custom issuer for the TOTP URI"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","enum":["otp","totp"],"description":"The 2FA method that was enabled."},"totpURI":{"type":"string","description":"TOTP URI for authenticator app setup. Only present when method is 'totp'."},"backupCodes":{"type":"array","items":{"type":"string"},"description":"Recovery backup codes. Only present when method is 'totp'."}},"required":["method"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/two-factor/disable":{"post":{"tags":["Two-factor"],"description":"Use this endpoint to disable two factor authentication.","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","description":"User password"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/admin/set-role":{"post":{"tags":["Admin"],"description":"Set the role of a user","operationId":"setUserRole","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id"},"role":{"anyOf":[{"type":"string","description":"The role to set. `admin` or `user` by default"},{"type":"array","items":{"type":"string","description":"The roles to set. `admin` or `user` by default"}}],"description":"The role to set, this can be a string or an array of strings. Eg: `admin` or `[admin, user]`"}},"required":["userId","role"]}}}},"responses":{"200":{"description":"User role updated","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/admin/get-user":{"get":{"tags":["Admin"],"description":"Get an existing user","operationId":"getUser","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"query","schema":{"type":"string","description":"The id of the User"}}],"responses":{"200":{"description":"User","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/admin/create-user":{"post":{"tags":["Admin"],"description":"Create a new user","operationId":"createUser","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"The email of the user"},"password":{"type":"string"},"name":{"type":"string","description":"The name of the user"},"role":{"anyOf":[{"type":"string","description":"The role of the user"},{"type":"array","items":{"type":"string","description":"The roles of user"}}]},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["email","name"]}}}},"responses":{"200":{"description":"User created","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/admin/update-user":{"post":{"tags":["Admin"],"description":"Update a user's details","operationId":"adminUpdateUser","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id"},"data":{"type":"object","propertyNames":{},"additionalProperties":{},"description":"The user data to update"}},"required":["userId","data"]}}}},"responses":{"200":{"description":"User updated","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/admin/list-users":{"get":{"tags":["Admin"],"description":"List users","operationId":"listUsers","security":[{"bearerAuth":[]}],"parameters":[{"name":"searchValue","in":"query","schema":{"type":"string"}},{"name":"searchField","in":"query","schema":{"type":"string","enum":["email","name"],"description":"The field to search in, defaults to email. Can be `email` or `name`. Eg: \"name\""}},{"name":"searchOperator","in":"query","schema":{"type":"string","enum":["contains","starts_with","ends_with"],"description":"The operator to use for the search. Can be `contains`, `starts_with` or `ends_with`. Eg: \"contains\""}},{"name":"limit","in":"query","schema":{"anyOf":[{"type":"string","description":"The number of users to return"},{"type":"number"}]}},{"name":"offset","in":"query","schema":{"anyOf":[{"type":"string","description":"The offset to start from"},{"type":"number"}]}},{"name":"sortBy","in":"query","schema":{"type":"string","description":"The field to sort by"}},{"name":"sortDirection","in":"query","schema":{"type":"string","enum":["asc","desc"],"description":"The direction to sort by"}},{"name":"filterField","in":"query","schema":{"type":"string","description":"The field to filter by"}},{"name":"filterValue","in":"query","schema":{"anyOf":[{"anyOf":[{"anyOf":[{"anyOf":[{"type":"string","description":"The value to filter by"},{"type":"number"}]},{"type":"boolean"}]},{"type":"array","items":{"type":"string"}}]},{"type":"array","items":{"type":"number"}}]}},{"name":"filterOperator","in":"query","schema":{"type":"string","enum":["eq","ne","lt","lte","gt","gte","in","not_in","contains","starts_with","ends_with"],"description":"The operator to use for the filter"}}],"responses":{"200":{"description":"List of users","content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/User"}},"total":{"type":"number"},"limit":{"type":"number"},"offset":{"type":"number"}},"required":["users","total"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/admin/list-user-sessions":{"post":{"tags":["Admin"],"description":"List user sessions","operationId":"adminListUserSessions","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id"}},"required":["userId"]}}}},"responses":{"200":{"description":"List of user sessions","content":{"application/json":{"schema":{"type":"object","properties":{"sessions":{"type":"array","items":{"$ref":"#/components/schemas/Session"}}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/admin/unban-user":{"post":{"tags":["Admin"],"description":"Unban a user","operationId":"unbanUser","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id"}},"required":["userId"]}}}},"responses":{"200":{"description":"User unbanned","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/admin/ban-user":{"post":{"tags":["Admin"],"description":"Ban a user","operationId":"banUser","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id"},"banReason":{"type":"string","description":"The reason for the ban"},"banExpiresIn":{"type":"number","description":"The number of seconds until the ban expires"}},"required":["userId"]}}}},"responses":{"200":{"description":"User banned","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/admin/impersonate-user":{"post":{"tags":["Admin"],"description":"Impersonate a user","operationId":"impersonateUser","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id"}},"required":["userId"]}}}},"responses":{"200":{"description":"Impersonation session created","content":{"application/json":{"schema":{"type":"object","properties":{"session":{"$ref":"#/components/schemas/Session"},"user":{"$ref":"#/components/schemas/User"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/admin/stop-impersonating":{"post":{"tags":["Admin"],"security":[{"bearerAuth":[]}],"parameters":[],"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/admin/revoke-user-session":{"post":{"tags":["Admin"],"description":"Revoke a user session","operationId":"revokeUserSession","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sessionToken":{"type":"string","description":"The session token"}},"required":["sessionToken"]}}}},"responses":{"200":{"description":"Session revoked","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/admin/revoke-user-sessions":{"post":{"tags":["Admin"],"description":"Revoke all user sessions","operationId":"revokeUserSessions","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id"}},"required":["userId"]}}}},"responses":{"200":{"description":"Sessions revoked","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/admin/remove-user":{"post":{"tags":["Admin"],"description":"Delete a user and all their sessions and accounts. Cannot be undone.","operationId":"removeUser","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id"}},"required":["userId"]}}}},"responses":{"200":{"description":"User removed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/admin/set-user-password":{"post":{"tags":["Admin"],"description":"Set a user's password","operationId":"setUserPassword","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"newPassword":{"type":"string","minLength":1,"description":"The new password"},"userId":{"type":"string","minLength":1,"description":"The user id"}},"required":["newPassword","userId"]}}}},"responses":{"200":{"description":"Password set","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/admin/has-permission":{"post":{"tags":["Admin"],"description":"Check if the user has permission","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"permissions":{"type":"object","description":"The permission to check"}},"required":["permissions"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/create":{"post":{"tags":["Organization"],"description":"Create an organization","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The name of the organization"},"slug":{"type":"string","minLength":1,"description":"The slug of the organization"},"userId":{"type":"string","description":"The user id of the organization creator. If not provided, the current user will be used. Should only be used by admins or when called by the server. server-only. Eg: \"user-id\""},"logo":{"type":["string","null"],"description":"The logo of the organization"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The metadata of the organization"},"keepCurrentActiveOrganization":{"type":"boolean","description":"Whether to keep the current active organization active after creating a new one. Eg: true"},"updatedAt":{"type":["string","null"]},"isArchived":{"type":["boolean","null"]},"archivedAt":{"type":["string","null"]}},"required":["name","slug"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","description":"The organization that was created","$ref":"#/components/schemas/Organization"}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/update":{"post":{"tags":["Organization"],"description":"Update an organization","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"updatedAt":{"type":["string","null"]},"isArchived":{"type":["boolean","null"]},"archivedAt":{"type":["string","null"]},"name":{"type":"string","minLength":1,"description":"The name of the organization"},"slug":{"type":"string","minLength":1,"description":"The slug of the organization"},"logo":{"type":["string","null"],"description":"The logo of the organization"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The metadata of the organization"}}},"organizationId":{"type":"string","description":"The organization ID. Eg: \"org-id\""}},"required":["data"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","description":"The updated organization","$ref":"#/components/schemas/Organization"}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/delete":{"post":{"tags":["Organization"],"description":"Delete an organization","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","description":"The organization id to delete"}},"required":["organizationId"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"string","description":"The organization id that was deleted"}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/set-active":{"post":{"tags":["Organization"],"description":"Set the active organization","operationId":"setActiveOrganization","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":["string","null"],"description":"The organization id to set as active. It can be null to unset the active organization. Eg: \"org-id\""},"organizationSlug":{"type":"string","description":"The organization slug to set as active. It can be null to unset the active organization if organizationId is not provided. Eg: \"org-slug\""}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","description":"The organization","$ref":"#/components/schemas/Organization"}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/get-organization":{"get":{"tags":["Organization"],"description":"Get the organization metadata","operationId":"getOrganization","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","description":"The organization","$ref":"#/components/schemas/Organization"}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/get-full-organization":{"get":{"tags":["Organization"],"description":"Get the full organization","operationId":"getFullOrganization","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","description":"The organization","$ref":"#/components/schemas/Organization"}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/list":{"get":{"tags":["Organization"],"description":"List all organizations","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/invite-member":{"post":{"tags":["Organization"],"description":"Create an invitation to an organization","operationId":"createOrganizationInvitation","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"The email address of the user to invite"},"role":{"anyOf":[{"type":"string","description":"The role to assign to the user"},{"type":"array","items":{"type":"string","description":"The roles to assign to the user"}}],"description":"The role(s) to assign to the user. It can be `admin`, `member`, owner. Eg: \"member\""},"organizationId":{"type":"string","description":"The organization ID to invite the user to"},"resend":{"type":"boolean","description":"Resend the invitation email, if the user is already invited. Eg: true"},"teamId":{"anyOf":[{"type":"string","description":"The team ID to invite the user to"},{"type":"array","items":{"type":"string"},"description":"The team IDs to invite the user to"}]},"updatedAt":{"type":["string","null"]},"status":{"type":"string"},"source":{"type":["string","null"]},"oauthScopes":{"type":["array","null"],"items":{"type":"string"}},"oauthRedirectUri":{"type":["string","null"]}},"required":["email","role","status"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"},"organizationId":{"type":"string"},"inviterId":{"type":"string"},"status":{"type":"string"},"expiresAt":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","email","role","organizationId","inviterId","status","expiresAt","createdAt"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/cancel-invitation":{"post":{"tags":["Organization"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invitationId":{"type":"string","description":"The ID of the invitation to cancel"}},"required":["invitationId"]}}}},"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/accept-invitation":{"post":{"tags":["Organization"],"description":"Accept an invitation to an organization","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invitationId":{"type":"string","description":"The ID of the invitation to accept"}},"required":["invitationId"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"invitation":{"type":"object"},"member":{"type":"object"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/get-invitation":{"get":{"tags":["Organization"],"description":"Get an invitation by ID","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"query","schema":{"type":"string","description":"The ID of the invitation to get"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"},"organizationId":{"type":"string"},"inviterId":{"type":"string"},"status":{"type":"string"},"expiresAt":{"type":"string"},"organizationName":{"type":"string"},"organizationSlug":{"type":"string"},"inviterEmail":{"type":"string"}},"required":["id","email","role","organizationId","inviterId","status","expiresAt","organizationName","organizationSlug","inviterEmail"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/reject-invitation":{"post":{"tags":["Organization"],"description":"Reject an invitation to an organization","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invitationId":{"type":"string","description":"The ID of the invitation to reject"}},"required":["invitationId"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"invitation":{"type":"object"},"member":{"type":"object","nullable":true}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/list-invitations":{"get":{"tags":["Organization"],"security":[{"bearerAuth":[]}],"parameters":[],"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/get-active-member":{"get":{"tags":["Organization"],"description":"Get the member details of the active organization","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"role":{"type":"string"}},"required":["id","userId","organizationId","role"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/check-slug":{"post":{"tags":["Organization"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","description":"The organization slug to check. Eg: \"my-org\""}},"required":["slug"]}}}},"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/remove-member":{"post":{"tags":["Organization"],"description":"Remove a member from an organization","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"memberIdOrEmail":{"type":"string","description":"The ID or email of the member to remove"},"organizationId":{"type":"string","description":"The ID of the organization to remove the member from. If not provided, the active organization will be used. Eg: \"org-id\""}},"required":["memberIdOrEmail"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"member":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"role":{"type":"string"}},"required":["id","userId","organizationId","role"]}},"required":["member"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/update-member-role":{"post":{"tags":["Organization"],"description":"Update the role of a member in an organization","operationId":"updateOrganizationMemberRole","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The new role to be applied. This can be a string or array of strings representing the roles. Eg: [\"admin\", \"sale\"]"},"memberId":{"type":"string","description":"The member id to apply the role update to. Eg: \"member-id\""},"organizationId":{"type":"string","description":"An optional organization ID which the member is a part of to apply the role update. If not provided, you must provide session headers to get the active organization. Eg: \"organization-id\""}},"required":["role","memberId"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"member":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"role":{"type":"string"}},"required":["id","userId","organizationId","role"]}},"required":["member"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/leave":{"post":{"tags":["Organization"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","description":"The organization Id for the member to leave. Eg: \"organization-id\""}},"required":["organizationId"]}}}},"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/list-user-invitations":{"get":{"tags":["Organization"],"description":"List all invitations a user has received","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"},"organizationId":{"type":"string"},"organizationName":{"type":"string"},"inviterId":{"type":"string","description":"The ID of the user who created the invitation"},"teamId":{"type":"string","description":"The ID of the team associated with the invitation","nullable":true},"status":{"type":"string"},"expiresAt":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","email","role","organizationId","organizationName","inviterId","status","expiresAt","createdAt"]}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/get-active-member-role":{"get":{"tags":["Organization"],"security":[{"bearerAuth":[]}],"parameters":[],"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/create-team":{"post":{"tags":["Organization"],"description":"Create a new team within an organization","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the team. Eg: \"my-team\""},"organizationId":{"type":"string","description":"The organization ID which the team will be created in. Defaults to the active organization. Eg: \"organization-id\""},"status":{"type":"string"}},"required":["name","status"]}}}},"responses":{"200":{"description":"Team created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the created team"},"name":{"type":"string","description":"Name of the team"},"organizationId":{"type":"string","description":"ID of the organization the team belongs to"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the team was created"},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the team was last updated"}},"required":["id","name","organizationId","createdAt","updatedAt"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/remove-team":{"post":{"tags":["Organization"],"description":"Remove a team from an organization","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","description":"The team ID of the team to remove. Eg: \"team-id\""},"organizationId":{"type":"string","description":"The organization ID which the team falls under. If not provided, it will default to the user's active organization. Eg: \"organization-id\""}},"required":["teamId"]}}}},"responses":{"200":{"description":"Team removed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Confirmation message indicating successful removal","enum":["Team removed successfully."]}},"required":["message"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/update-team":{"post":{"tags":["Organization"],"description":"Update an existing team in an organization","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team to be updated. Eg: \"team-id\""},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"organizationId":{"type":"string"},"status":{"type":"string"}}}},"required":["teamId","data"]}}}},"responses":{"200":{"description":"Team updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the updated team"},"name":{"type":"string","description":"Updated name of the team"},"organizationId":{"type":"string","description":"ID of the organization the team belongs to"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the team was created"},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the team was last updated"}},"required":["id","name","organizationId","createdAt","updatedAt"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/set-active-team":{"post":{"tags":["Organization"],"description":"Set the active team for the current active organization","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":["string","null"],"description":"The team id to set as active. It can be null to unset the active team"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","description":"The team","$ref":"#/components/schemas/Team"}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/list-user-teams":{"get":{"tags":["Organization"],"description":"List teams for a user. Without parameters, returns teams for the current user across every organization they belong to. Pass `organizationId` to scope the result to a specific organization. Pass `userId` to list teams for another member; this requires `member:update` permission in the target organization (the explicit `organizationId` if provided, otherwise the session's active organization).","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Teams retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","description":"The team","$ref":"#/components/schemas/Team"},"description":"Array of team objects within the organization"}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/list-team-members":{"get":{"tags":["Organization"],"description":"List the members of the given team.","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Teams retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","description":"The team member","properties":{"id":{"type":"string","description":"Unique identifier of the team member"},"userId":{"type":"string","description":"The user ID of the team member"},"teamId":{"type":"string","description":"The team ID of the team the team member is in"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the team member was created"}},"required":["id","userId","teamId","createdAt"]},"description":"Array of team member objects within the team"}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/add-team-member":{"post":{"tags":["Organization"],"description":"The newly created member","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","description":"The team the user should be a member of."},"userId":{"type":"string","description":"The user Id which represents the user to be added as a member."},"organizationId":{"type":"string","description":"The organization ID which the team falls under. If not provided, it will default to the user's active organization."}},"required":["teamId","userId"]}}}},"responses":{"200":{"description":"Team member created successfully","content":{"application/json":{"schema":{"type":"object","description":"The team member","properties":{"id":{"type":"string","description":"Unique identifier of the team member"},"userId":{"type":"string","description":"The user ID of the team member"},"teamId":{"type":"string","description":"The team ID of the team the team member is in"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the team member was created"}},"required":["id","userId","teamId","createdAt"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/remove-team-member":{"post":{"tags":["Organization"],"description":"Remove a member from a team","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","description":"The team the user should be removed from."},"userId":{"type":"string","description":"The user which should be removed from the team."},"organizationId":{"type":"string","description":"The organization ID which the team falls under. If not provided, it will default to the user's active organization."}},"required":["teamId","userId"]}}}},"responses":{"200":{"description":"Team member removed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Confirmation message indicating successful removal","enum":["Team member removed successfully."]}},"required":["message"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/create-role":{"post":{"tags":["Organization"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string"},"role":{"type":"string","description":"The name of the role to create"},"permission":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}},"description":"The permission to assign to the role"},"additionalFields":{"type":"object","properties":{}}},"required":["role","permission"]}}}},"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/delete-role":{"post":{"tags":["Organization"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"organizationId":{"type":"string"}}},{"anyOf":[{"type":"object","properties":{"roleName":{"type":"string","minLength":1,"description":"The name of the role to delete"}},"required":["roleName"]},{"type":"object","properties":{"roleId":{"type":"string","minLength":1,"description":"The id of the role to delete"}},"required":["roleId"]}]}]}}}},"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/list-roles":{"get":{"tags":["Organization"],"security":[{"bearerAuth":[]}],"parameters":[],"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/get-role":{"get":{"tags":["Organization"],"security":[{"bearerAuth":[]}],"parameters":[],"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/update-role":{"post":{"tags":["Organization"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"organizationId":{"type":"string"},"data":{"type":"object","properties":{"permission":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},"roleName":{"type":"string"}}}},"required":["data"]},{"anyOf":[{"type":"object","properties":{"roleName":{"type":"string","minLength":1,"description":"The name of the role to update"}},"required":["roleName"]},{"type":"object","properties":{"roleId":{"type":"string","minLength":1,"description":"The id of the role to update"}},"required":["roleId"]}]}]}}}},"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/organization/has-permission":{"post":{"tags":["Organization"],"description":"Check if the user has permission","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"permission":{"type":"object","description":"The permission to check","deprecated":true},"permissions":{"type":"object","description":"The permission to check"}},"required":["permissions"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/authorization/check":{"post":{"tags":["Authorization"],"description":"Check one permission for the caller. The subject and the organization come from the access token (or the session without one), never from the body. A refusal is a 200 with `allowed: false`, not a 403: the caller decides what to do with the answer.","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plane":{"type":"string","enum":["admin","organization"]},"permission":{"type":"string"}},"required":["plane","permission"]}}}},"responses":{"200":{"description":"Whether the session's subject holds the permission, and who decided.","content":{"application/json":{"schema":{"type":"object","properties":{"allowed":{"type":"boolean","description":"The decision to act on. A refusal is still a 200."},"reason":{"type":["string","null"],"description":"Why, from whoever decided: a registry reason under `enforce`, or `legacy_allow`/`legacy_deny` while the pre-registry check decides. Null when the host reports none. The set grows, so keep a default branch."},"mode":{"type":["string","null"],"enum":["legacy","shadow","enforce",null],"description":"Resolved per permission from the global setting and the permission's own `enforcement`, so two keys in one batch can differ."}},"required":["allowed","reason","mode"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/authorization/batch-check":{"post":{"tags":["Authorization"],"description":"Check up to fifty permissions in one call. Meant for painting a surface: its refusals are capability questions and stay out of the deny telemetry. An unregistered key answers `deny_unknown_permission` rather than failing the batch.","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plane":{"type":"string","enum":["admin","organization"]},"permissions":{"type":"array","items":{"type":"string"}}},"required":["plane","permissions"]}}}},"responses":{"200":{"description":"One answer per distinct permission asked.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"object","description":"Keyed by permission. Repeated keys collapse to one entry.","additionalProperties":{"type":"object","properties":{"allowed":{"type":"boolean","description":"The decision to act on. A refusal is still a 200."},"reason":{"type":["string","null"],"description":"Why, from whoever decided: a registry reason under `enforce`, or `legacy_allow`/`legacy_deny` while the pre-registry check decides. Null when the host reports none. The set grows, so keep a default branch."},"mode":{"type":["string","null"],"enum":["legacy","shadow","enforce",null],"description":"Resolved per permission from the global setting and the permission's own `enforcement`, so two keys in one batch can differ."}},"required":["allowed","reason","mode"]}}},"required":["results"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/authorization/list-organization-roles":{"get":{"tags":["Authorization"],"description":"List the roles of an organization, a page at a time. Includes native roles that have never been edited here, so the list matches what `members.role` can hold. Omitting `organizationId` uses the session's active organization. `cursor` is a zero-based page index; `search` matches the identifier, display name and description; `system=true` keeps only system roles (`systemRoleId` set, read-only to the organization) and `system=false` only the organization's own.","security":[{"bearerAuth":[]}],"parameters":[{"name":"organizationId","in":"query","schema":{"type":"string","minLength":1}},{"name":"cursor","in":"query","schema":{"type":"number"}},{"name":"limit","in":"query","schema":{"type":"number"}},{"name":"search","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"anyOf":[{"type":"string","enum":["active","archived"]},{"type":"array","items":{"type":"string","enum":["active","archived"]}}]}},{"name":"system","in":"query","schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["true","false"]}]}},{"name":"sortBy","in":"query","schema":{"type":"string","enum":["rank","role","displayName","createdAt"]}},{"name":"sortDirection","in":"query","schema":{"type":"string","enum":["asc","desc"]}}],"responses":{"200":{"description":"One page of the organization's roles, native rows included.","content":{"application/json":{"schema":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The native role's id: the `roleId` every endpoint takes."},"organizationId":{"type":"string","format":"uuid"},"role":{"type":"string","description":"The identifier stored in `members.role`."},"type":{"type":["string","null"]},"displayName":{"type":"string"},"description":{"type":["string","null"]},"systemRoleId":{"type":["string","null"],"format":"uuid","description":"Set when this is a system role: its permissions are managed by identity and cannot be edited by the organization."},"rank":{"type":"integer"},"status":{"type":"string","enum":["active","archived"]},"archivedAt":{"type":["string","null"],"format":"date-time"},"createdByUserId":{"type":["string","null"],"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"permissions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"Dot-separated `{application}.{resource}.{action}`."},"effect":{"type":"string","enum":["allow","deny"]}},"required":["key","effect"]}}},"required":["id","organizationId","role","type","displayName","description","systemRoleId","rank","status","archivedAt","createdByUserId","createdAt","updatedAt","permissions"]}},"nextCursor":{"type":["integer","null"],"description":"The next page's `cursor`, or null on the last page."},"previousCursor":{"type":["integer","null"]},"limit":{"type":"integer"},"total":{"type":"integer","description":"Roles matching the filters, across every page."}},"required":["roles","nextCursor","previousCursor","limit","total"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/authorization/get-organization-role":{"get":{"tags":["Authorization"],"description":"Read one organization role with its grants. `roleId` is the native role's id. A role that has never been edited here answers with its native permissions mapped to keys.","security":[{"bearerAuth":[]}],"parameters":[{"name":"organizationId","in":"query","schema":{"type":"string","minLength":1}},{"name":"roleId","in":"query","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"One organization role with its grants.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The native role's id: the `roleId` every endpoint takes."},"organizationId":{"type":"string","format":"uuid"},"role":{"type":"string","description":"The identifier stored in `members.role`."},"type":{"type":["string","null"]},"displayName":{"type":"string"},"description":{"type":["string","null"]},"systemRoleId":{"type":["string","null"],"format":"uuid","description":"Set when this is a system role: its permissions are managed by identity and cannot be edited by the organization."},"rank":{"type":"integer"},"status":{"type":"string","enum":["active","archived"]},"archivedAt":{"type":["string","null"],"format":"date-time"},"createdByUserId":{"type":["string","null"],"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"permissions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"Dot-separated `{application}.{resource}.{action}`."},"effect":{"type":"string","enum":["allow","deny"]}},"required":["key","effect"]}}},"required":["id","organizationId","role","type","displayName","description","systemRoleId","rank","status","archivedAt","createdByUserId","createdAt","updatedAt","permissions"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/authorization/create-organization-role":{"post":{"tags":["Authorization"],"description":"Create a custom role in an organization. `role` is what `members.role` stores and legacy resolution matches on, so it is slug-shaped and immutable once created. Grants are given as permission keys and mirrored into the native row in the same transaction.","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"role":{"type":"string","minLength":3,"maxLength":64},"displayName":{"type":"string","minLength":1,"maxLength":100},"description":{"type":["string","null"],"maxLength":500},"permissions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"effect":{"type":"string","enum":["allow","deny"]}},"required":["key"]}}},"required":["role","displayName"]}}}},"responses":{"200":{"description":"The committed role with its grants, plus whether the write changed anything.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The native role's id: the `roleId` every endpoint takes."},"organizationId":{"type":"string","format":"uuid"},"role":{"type":"string","description":"The identifier stored in `members.role`."},"type":{"type":["string","null"]},"displayName":{"type":"string"},"description":{"type":["string","null"]},"systemRoleId":{"type":["string","null"],"format":"uuid","description":"Set when this is a system role: its permissions are managed by identity and cannot be edited by the organization."},"rank":{"type":"integer"},"status":{"type":"string","enum":["active","archived"]},"archivedAt":{"type":["string","null"],"format":"date-time"},"createdByUserId":{"type":["string","null"],"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"permissions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"Dot-separated `{application}.{resource}.{action}`."},"effect":{"type":"string","enum":["allow","deny"]}},"required":["key","effect"]}},"write":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"changed":{"type":"boolean"}},"required":["id","changed"]}},"required":["id","organizationId","role","type","displayName","description","systemRoleId","rank","status","archivedAt","createdByUserId","createdAt","updatedAt","permissions","write"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/authorization/update-organization-role":{"post":{"tags":["Authorization"],"description":"Rename or describe an organization role. Only the label and the description. The identifier is immutable, and a native role that has never been edited here is onboarded on its first edit, carrying its native permissions over.","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"roleId":{"type":"string","minLength":1},"displayName":{"type":"string","minLength":1,"maxLength":100},"description":{"type":["string","null"],"maxLength":500}},"required":["roleId"]}}}},"responses":{"200":{"description":"The committed role with its grants, plus whether the write changed anything.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The native role's id: the `roleId` every endpoint takes."},"organizationId":{"type":"string","format":"uuid"},"role":{"type":"string","description":"The identifier stored in `members.role`."},"type":{"type":["string","null"]},"displayName":{"type":"string"},"description":{"type":["string","null"]},"systemRoleId":{"type":["string","null"],"format":"uuid","description":"Set when this is a system role: its permissions are managed by identity and cannot be edited by the organization."},"rank":{"type":"integer"},"status":{"type":"string","enum":["active","archived"]},"archivedAt":{"type":["string","null"],"format":"date-time"},"createdByUserId":{"type":["string","null"],"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"permissions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"Dot-separated `{application}.{resource}.{action}`."},"effect":{"type":"string","enum":["allow","deny"]}},"required":["key","effect"]}},"write":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"changed":{"type":"boolean"}},"required":["id","changed"]}},"required":["id","organizationId","role","type","displayName","description","systemRoleId","rank","status","archivedAt","createdByUserId","createdAt","updatedAt","permissions","write"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/authorization/set-organization-role-permissions":{"post":{"tags":["Authorization"],"description":"Replace an organization role's grants. The whole set at once, so a permissions form saves as one atomic write. An editor cannot grant what they do not hold in that organization, and `organization_roles.permission` is regenerated in the same transaction.","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"roleId":{"type":"string","minLength":1},"permissions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"effect":{"type":"string","enum":["allow","deny"]}},"required":["key"]}}},"required":["roleId","permissions"]}}}},"responses":{"200":{"description":"The committed role with its grants, plus whether the write changed anything.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The native role's id: the `roleId` every endpoint takes."},"organizationId":{"type":"string","format":"uuid"},"role":{"type":"string","description":"The identifier stored in `members.role`."},"type":{"type":["string","null"]},"displayName":{"type":"string"},"description":{"type":["string","null"]},"systemRoleId":{"type":["string","null"],"format":"uuid","description":"Set when this is a system role: its permissions are managed by identity and cannot be edited by the organization."},"rank":{"type":"integer"},"status":{"type":"string","enum":["active","archived"]},"archivedAt":{"type":["string","null"],"format":"date-time"},"createdByUserId":{"type":["string","null"],"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"permissions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"Dot-separated `{application}.{resource}.{action}`."},"effect":{"type":"string","enum":["allow","deny"]}},"required":["key","effect"]}},"write":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"changed":{"type":"boolean"}},"required":["id","changed"]}},"required":["id","organizationId","role","type","displayName","description","systemRoleId","rank","status","archivedAt","createdByUserId","createdAt","updatedAt","permissions","write"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/api-key/create":{"post":{"tags":["Api-key"],"description":"Create a new API key for a user","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"configId":{"type":"string","description":"The configuration ID to use for the API key. If not provided, the default configuration will be used."},"name":{"type":"string","description":"Name of the Api Key"},"expiresIn":{"type":["number","null"],"description":"Expiration time of the Api Key in seconds"},"prefix":{"type":"string","description":"Prefix of the Api Key"},"remaining":{"type":["number","null"],"description":"Remaining number of requests. Server side only"},"metadata":{},"refillAmount":{"type":"number","description":"Amount to refill the remaining count of the Api Key. server-only. Eg: 100"},"refillInterval":{"type":"number","description":"Interval to refill the Api Key in milliseconds. server-only. Eg: 1000"},"rateLimitTimeWindow":{"type":"number","description":"The duration in milliseconds where each request is counted. Once the `maxRequests` is reached, the request will be rejected until the `timeWindow` has passed, at which point the `timeWindow` will be reset. server-only. Eg: 1000"},"rateLimitMax":{"type":"number","description":"Maximum amount of requests allowed within a window. Once the `maxRequests` is reached, the request will be rejected until the `timeWindow` has passed, at which point the `timeWindow` will be reset. server-only. Eg: 100"},"rateLimitEnabled":{"type":"boolean","description":"Whether the key has rate limiting enabled. server-only. Eg: true"},"permissions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}},"description":"Permissions of the Api Key."},"userId":{"type":"string","description":"User Id of the user that the Api Key belongs to. server-only. Eg: \"user-id\""},"organizationId":{"type":"string","description":"Organization Id of the organization that the Api Key belongs to. Eg: 'org-id'"}}}}}},"responses":{"200":{"description":"API key created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the API key"},"createdAt":{"type":"string","format":"date-time","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","description":"Last update timestamp"},"name":{"type":"string","nullable":true,"description":"Name of the API key"},"prefix":{"type":"string","nullable":true,"description":"Prefix of the API key"},"start":{"type":"string","nullable":true,"description":"Starting characters of the key (if configured)"},"key":{"type":"string","description":"The full API key (only returned on creation)"},"enabled":{"type":"boolean","description":"Whether the key is enabled"},"expiresAt":{"type":"string","format":"date-time","nullable":true,"description":"Expiration timestamp"},"referenceId":{"type":"string","description":"ID of the reference owning the key"},"lastRefillAt":{"type":"string","format":"date-time","nullable":true,"description":"Last refill timestamp"},"lastRequest":{"type":"string","format":"date-time","nullable":true,"description":"Last request timestamp"},"metadata":{"type":"object","nullable":true,"additionalProperties":true,"description":"Metadata associated with the key"},"rateLimitMax":{"type":"number","nullable":true,"description":"Maximum requests in time window"},"rateLimitTimeWindow":{"type":"number","nullable":true,"description":"Rate limit time window in milliseconds"},"remaining":{"type":"number","nullable":true,"description":"Remaining requests"},"refillAmount":{"type":"number","nullable":true,"description":"Amount to refill"},"refillInterval":{"type":"number","nullable":true,"description":"Refill interval in milliseconds"},"rateLimitEnabled":{"type":"boolean","description":"Whether rate limiting is enabled"},"requestCount":{"type":"number","description":"Current request count in window"},"permissions":{"type":"object","nullable":true,"additionalProperties":{"type":"array","items":{"type":"string"}},"description":"Permissions associated with the key"}},"required":["id","createdAt","updatedAt","key","enabled","referenceId","rateLimitEnabled","requestCount"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/api-key/get":{"get":{"tags":["Api-key"],"description":"Retrieve an existing API key by ID","security":[{"bearerAuth":[]}],"parameters":[{"name":"configId","in":"query","schema":{"type":"string","description":"The configuration ID to use for the API key lookup. If not provided, the default configuration will be used."}},{"name":"id","in":"query","schema":{"type":"string","description":"The id of the Api Key"}}],"responses":{"200":{"description":"API key retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID"},"name":{"type":"string","nullable":true,"description":"The name of the key"},"start":{"type":"string","nullable":true,"description":"Shows the first few characters of the API key, including the prefix. This allows you to show those few characters in the UI to make it easier for users to identify the API key."},"prefix":{"type":"string","nullable":true,"description":"The API Key prefix. Stored as plain text."},"userId":{"type":"string","description":"The owner of the user id"},"refillInterval":{"type":"number","nullable":true,"description":"The interval in milliseconds between refills of the `remaining` count. Example: 3600000 // refill every hour (3600000ms = 1h)"},"refillAmount":{"type":"number","nullable":true,"description":"The amount to refill"},"lastRefillAt":{"type":"string","format":"date-time","nullable":true,"description":"The last refill date"},"enabled":{"type":"boolean","description":"Sets if key is enabled or disabled","default":true},"rateLimitEnabled":{"type":"boolean","description":"Whether the key has rate limiting enabled"},"rateLimitTimeWindow":{"type":"number","nullable":true,"description":"The duration in milliseconds"},"rateLimitMax":{"type":"number","nullable":true,"description":"Maximum amount of requests allowed within a window"},"requestCount":{"type":"number","description":"The number of requests made within the rate limit time window"},"remaining":{"type":"number","nullable":true,"description":"Remaining requests (every time api key is used this should updated and should be updated on refill as well)"},"lastRequest":{"type":"string","format":"date-time","nullable":true,"description":"When last request occurred"},"expiresAt":{"type":"string","format":"date-time","nullable":true,"description":"Expiry date of a key"},"createdAt":{"type":"string","format":"date-time","description":"created at"},"updatedAt":{"type":"string","format":"date-time","description":"updated at"},"metadata":{"type":"object","nullable":true,"additionalProperties":true,"description":"Extra metadata about the apiKey"},"permissions":{"type":"string","nullable":true,"description":"Permissions for the api key (stored as JSON string)"}},"required":["id","userId","enabled","rateLimitEnabled","requestCount","createdAt","updatedAt"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/api-key/update":{"post":{"tags":["Api-key"],"description":"Update an existing API key by ID","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"configId":{"type":"string","description":"The configuration ID to use for the API key lookup. If not provided, the default configuration will be used."},"keyId":{"type":"string","description":"The id of the Api Key"},"userId":{"type":"string","description":"The id of the user which the api key belongs to. server-only. Eg: \"some-user-id\""},"name":{"type":"string","description":"The name of the key"},"enabled":{"type":"boolean","description":"Whether the Api Key is enabled or not"},"remaining":{"type":"number","description":"The number of remaining requests"},"refillAmount":{"type":"number","description":"The refill amount"},"refillInterval":{"type":"number","description":"The refill interval"},"metadata":{},"expiresIn":{"type":["number","null"],"description":"Expiration time of the Api Key in seconds"},"rateLimitEnabled":{"type":"boolean","description":"Whether the key has rate limiting enabled."},"rateLimitTimeWindow":{"type":"number","description":"The duration in milliseconds where each request is counted. server-only. Eg: 1000"},"rateLimitMax":{"type":"number","description":"Maximum amount of requests allowed within a window. Once the `maxRequests` is reached, the request will be rejected until the `timeWindow` has passed, at which point the `timeWindow` will be reset. server-only. Eg: 100"},"permissions":{"type":["object","null"],"propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}},"description":"Update the permissions on the API Key. server-only."}},"required":["keyId"]}}}},"responses":{"200":{"description":"API key updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID"},"name":{"type":"string","nullable":true,"description":"The name of the key"},"start":{"type":"string","nullable":true,"description":"Shows the first few characters of the API key, including the prefix. This allows you to show those few characters in the UI to make it easier for users to identify the API key."},"prefix":{"type":"string","nullable":true,"description":"The API Key prefix. Stored as plain text."},"userId":{"type":"string","description":"The owner of the user id"},"refillInterval":{"type":"number","nullable":true,"description":"The interval in milliseconds between refills of the `remaining` count. Example: 3600000 // refill every hour (3600000ms = 1h)"},"refillAmount":{"type":"number","nullable":true,"description":"The amount to refill"},"lastRefillAt":{"type":"string","format":"date-time","nullable":true,"description":"The last refill date"},"enabled":{"type":"boolean","description":"Sets if key is enabled or disabled","default":true},"rateLimitEnabled":{"type":"boolean","description":"Whether the key has rate limiting enabled"},"rateLimitTimeWindow":{"type":"number","nullable":true,"description":"The duration in milliseconds"},"rateLimitMax":{"type":"number","nullable":true,"description":"Maximum amount of requests allowed within a window"},"requestCount":{"type":"number","description":"The number of requests made within the rate limit time window"},"remaining":{"type":"number","nullable":true,"description":"Remaining requests (every time api key is used this should updated and should be updated on refill as well)"},"lastRequest":{"type":"string","format":"date-time","nullable":true,"description":"When last request occurred"},"expiresAt":{"type":"string","format":"date-time","nullable":true,"description":"Expiry date of a key"},"createdAt":{"type":"string","format":"date-time","description":"created at"},"updatedAt":{"type":"string","format":"date-time","description":"updated at"},"metadata":{"type":"object","nullable":true,"additionalProperties":true,"description":"Extra metadata about the apiKey"},"permissions":{"type":"string","nullable":true,"description":"Permissions for the api key (stored as JSON string)"}},"required":["id","userId","enabled","rateLimitEnabled","requestCount","createdAt","updatedAt"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/api-key/delete":{"post":{"tags":["Api-key"],"description":"Delete an existing API key","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"keyId":{"type":"string","description":"The id of the API key to delete"}},"required":["keyId"]}}}},"responses":{"200":{"description":"API key deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates if the API key was successfully deleted"}},"required":["success"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/api-key/list":{"get":{"tags":["Api-key"],"description":"List all API keys for the authenticated user or for a specific organization","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"API keys retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"apiKeys":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"ID"},"name":{"type":"string","nullable":true,"description":"The name of the key"},"start":{"type":"string","nullable":true,"description":"Shows the first few characters of the API key, including the prefix. This allows you to show those few characters in the UI to make it easier for users to identify the API key."},"prefix":{"type":"string","nullable":true,"description":"The API Key prefix. Stored as plain text."},"userId":{"type":"string","description":"The owner of the user id"},"refillInterval":{"type":"number","nullable":true,"description":"The interval in milliseconds between refills of the `remaining` count. Example: 3600000 // refill every hour (3600000ms = 1h)"},"refillAmount":{"type":"number","nullable":true,"description":"The amount to refill"},"lastRefillAt":{"type":"string","format":"date-time","nullable":true,"description":"The last refill date"},"enabled":{"type":"boolean","description":"Sets if key is enabled or disabled","default":true},"rateLimitEnabled":{"type":"boolean","description":"Whether the key has rate limiting enabled"},"rateLimitTimeWindow":{"type":"number","nullable":true,"description":"The duration in milliseconds"},"rateLimitMax":{"type":"number","nullable":true,"description":"Maximum amount of requests allowed within a window"},"requestCount":{"type":"number","description":"The number of requests made within the rate limit time window"},"remaining":{"type":"number","nullable":true,"description":"Remaining requests (every time api key is used this should updated and should be updated on refill as well)"},"lastRequest":{"type":"string","format":"date-time","nullable":true,"description":"When last request occurred"},"expiresAt":{"type":"string","format":"date-time","nullable":true,"description":"Expiry date of a key"},"createdAt":{"type":"string","format":"date-time","description":"created at"},"updatedAt":{"type":"string","format":"date-time","description":"updated at"},"metadata":{"type":"object","nullable":true,"additionalProperties":true,"description":"Extra metadata about the apiKey"},"permissions":{"type":"string","nullable":true,"description":"Permissions for the api key (stored as JSON string)"}},"required":["id","userId","enabled","rateLimitEnabled","requestCount","createdAt","updatedAt"]}},"total":{"type":"number","description":"Total number of API keys"},"limit":{"type":"number","nullable":true,"description":"The limit used for pagination"},"offset":{"type":"number","nullable":true,"description":"The offset used for pagination"}},"required":["apiKeys","total"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/jwks":{"get":{"tags":["Jwt"],"description":"Get the JSON Web Key Set","operationId":"getJSONWebKeySet","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"JSON Web Key Set retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","description":"Array of public JSON Web Keys","items":{"type":"object","properties":{"kid":{"type":"string","description":"Key ID uniquely identifying the key, corresponds to the 'id' from the stored Jwk"},"kty":{"type":"string","description":"Key type (e.g., 'RSA', 'EC', 'OKP')"},"alg":{"type":"string","description":"Algorithm intended for use with the key (e.g., 'EdDSA', 'RS256')"},"use":{"type":"string","description":"Intended use of the public key (e.g., 'sig' for signature)","enum":["sig"],"nullable":true},"n":{"type":"string","description":"Modulus for RSA keys (base64url-encoded)","nullable":true},"e":{"type":"string","description":"Exponent for RSA keys (base64url-encoded)","nullable":true},"crv":{"type":"string","description":"Curve name for elliptic curve keys (e.g., 'Ed25519', 'P-256')","nullable":true},"x":{"type":"string","description":"X coordinate for elliptic curve keys (base64url-encoded)","nullable":true},"y":{"type":"string","description":"Y coordinate for elliptic curve keys (base64url-encoded)","nullable":true}},"required":["kid","kty","alg"]}}},"required":["keys"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/token":{"get":{"tags":["Jwt"],"description":"Get a JWT token","operationId":"getJSONWebToken","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/authorize":{"get":{"tags":["Oauth-provider"],"description":"Authorize an OAuth 2.1 request from query parameters or an application/x-www-form-urlencoded POST body","security":[{"bearerAuth":[]}],"parameters":[{"name":"response_type","in":"query","required":false,"schema":{"type":"string"},"description":"OAuth 2.1 response type (e.g., 'code')"},{"name":"client_id","in":"query","required":true,"schema":{"type":"string"},"description":"OAuth 2.1 client ID"},{"name":"redirect_uri","in":"query","required":false,"schema":{"type":"string","format":"uri"},"description":"OAuth 2.1 redirect URI"},{"name":"scope","in":"query","required":false,"schema":{"type":"string"},"description":"OAuth 2.1 scopes (space-separated)"},{"name":"state","in":"query","required":false,"schema":{"type":"string"},"description":"OAuth 2.1 state parameter"},{"name":"request_uri","in":"query","required":false,"schema":{"type":"string"},"description":"Pushed Authorization Request URI referencing stored parameters"},{"name":"code_challenge","in":"query","required":false,"schema":{"type":"string"},"description":"PKCE code challenge"},{"name":"code_challenge_method","in":"query","required":false,"schema":{"type":"string"},"description":"PKCE code challenge method"},{"name":"nonce","in":"query","required":false,"schema":{"type":"string"},"description":"OpenID Connect nonce"},{"name":"max_age","in":"query","required":false,"schema":{"type":"integer","minimum":0},"description":"Maximum authentication age in seconds; forces re-authentication when exceeded"},{"name":"resource","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Requested protected resource(s) for the access token. May be supplied multiple times as repeated 'resource' query parameters (RFC 8707) or as an array of strings."},{"name":"prompt","in":"query","required":false,"schema":{"type":"string"},"description":"OAuth2 prompt parameter"}],"responses":{"302":{"description":"Redirect to client with code or error","headers":{"Location":{"description":"Redirect URI with code or error","schema":{"type":"string","format":"uri"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"state":{"type":"string"}},"required":["error"]}}}},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}},"post":{"tags":["Oauth-provider"],"description":"Authorize an OAuth 2.1 request from query parameters or an application/x-www-form-urlencoded POST body","security":[{"bearerAuth":[]}],"parameters":[{"name":"response_type","in":"query","required":false,"schema":{"type":"string"},"description":"OAuth 2.1 response type (e.g., 'code')"},{"name":"client_id","in":"query","required":true,"schema":{"type":"string"},"description":"OAuth 2.1 client ID"},{"name":"redirect_uri","in":"query","required":false,"schema":{"type":"string","format":"uri"},"description":"OAuth 2.1 redirect URI"},{"name":"scope","in":"query","required":false,"schema":{"type":"string"},"description":"OAuth 2.1 scopes (space-separated)"},{"name":"state","in":"query","required":false,"schema":{"type":"string"},"description":"OAuth 2.1 state parameter"},{"name":"request_uri","in":"query","required":false,"schema":{"type":"string"},"description":"Pushed Authorization Request URI referencing stored parameters"},{"name":"code_challenge","in":"query","required":false,"schema":{"type":"string"},"description":"PKCE code challenge"},{"name":"code_challenge_method","in":"query","required":false,"schema":{"type":"string"},"description":"PKCE code challenge method"},{"name":"nonce","in":"query","required":false,"schema":{"type":"string"},"description":"OpenID Connect nonce"},{"name":"max_age","in":"query","required":false,"schema":{"type":"integer","minimum":0},"description":"Maximum authentication age in seconds; forces re-authentication when exceeded"},{"name":"resource","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Requested protected resource(s) for the access token. May be supplied multiple times as repeated 'resource' query parameters (RFC 8707) or as an array of strings."},{"name":"prompt","in":"query","required":false,"schema":{"type":"string"},"description":"OAuth2 prompt parameter"}],"responses":{"302":{"description":"Redirect to client with code or error","headers":{"Location":{"description":"Redirect URI with code or error","schema":{"type":"string","format":"uri"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"state":{"type":"string"}},"required":["error"]}}}},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/consent":{"post":{"tags":["Oauth-provider"],"description":"Handle OAuth2 consent","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accept":{"type":"boolean","description":"Accept or deny user consent for a set of scopes"},"scope":{"type":"string"},"claims":{"anyOf":[{"type":"string"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]},"oauth_query":{"type":"string"}},"required":["accept"]}}}},"responses":{"200":{"description":"Consent processed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"redirect_uri":{"type":"string","format":"uri","description":"The URI to redirect to, either with an authorization code or an error"}},"required":["redirect_uri"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/continue":{"post":{"tags":["Oauth-provider"],"description":"Continues OAuth2 authorization flow","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"selected":{"type":"boolean"},"created":{"type":"boolean"},"postLogin":{"type":"boolean"},"oauth_query":{"type":"string"}}}}}},"responses":{"200":{"description":"Consent processed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"redirect_uri":{"type":"string","format":"uri","description":"The URI to redirect to, either with an authorization code or an error"}},"required":["redirect_uri"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/token":{"post":{"tags":["Oauth-provider"],"description":"Obtain an OAuth2.1 access token","security":[{"bearerAuth":[]}],"parameters":[{"name":"DPoP","in":"header","required":false,"schema":{"type":"string"},"description":"RFC 9449 DPoP proof JWT for issuing DPoP-bound tokens"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"grant_type":{"type":"string","description":"OAuth2 grant type"},"client_id":{"type":"string","description":"OAuth2 client ID"},"client_secret":{"type":"string","description":"OAuth2 client secret"},"code":{"type":"string","description":"Authorization code (for authorization_code grant)"},"code_verifier":{"type":"string","description":"PKCE code verifier (for authorization_code grant)"},"redirect_uri":{"type":"string","format":"uri","description":"Redirect URI (for authorization_code grant)"},"refresh_token":{"type":"string","description":"Refresh token (for refresh_token grant)"},"resource":{"oneOf":[{"type":"string","description":"Single resource (URL)"},{"type":"array","items":{"type":"string"},"description":"Multiple resources (URLs)"}],"description":"Requested protected resource(s) for the access token"},"scope":{"type":"string","description":"Requested scopes (for client_credentials grant)"}},"required":["grant_type"]}}}},"responses":{"200":{"description":"Access token response","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string","description":"The access token issued by the authorization server"},"token_type":{"type":"string","description":"The type of the token issued","enum":["Bearer","DPoP"]},"expires_in":{"type":"number","description":"Lifetime in seconds of the access token"},"refresh_token":{"type":"string","description":"Refresh token, if issued"},"scope":{"type":"string","description":"Scopes granted by the access token"},"id_token":{"type":"string","description":"ID Token (if OpenID Connect)"}},"required":["access_token","token_type","expires_in"]}}}},"400":{"description":"Invalid request or error response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"error_uri":{"type":"string"}},"required":["error"]}}}},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/introspect":{"post":{"tags":["Oauth-provider"],"description":"Introspect an OAuth2 access or refresh token","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string","description":"OAuth2 client ID"},"client_secret":{"type":"string","description":"OAuth2 client secret"},"token":{"type":"string","description":"The token to introspect (access or refresh token)"},"token_type_hint":{"type":"string","description":"Hint about the token type. Recognized values: `access_token`, `refresh_token`."}},"required":["token"]}}}},"responses":{"200":{"description":"Token introspection response","content":{"application/json":{"schema":{"type":"object","properties":{"active":{"type":"boolean","description":"Whether the token is active"},"scope":{"type":"string","description":"Scopes associated with the token"},"client_id":{"type":"string","description":"Client ID associated with the token"},"username":{"type":"string","description":"Username associated with the token"},"token_type":{"type":"string","description":"Type of the token"},"exp":{"type":"number","description":"Expiration time of the token (seconds since epoch)"},"iat":{"type":"number","description":"Issued at time (seconds since epoch)"},"nbf":{"type":"number","description":"Not before time (seconds since epoch)"},"sub":{"type":"string","description":"Subject of the token"},"aud":{"type":"string","description":"Audience of the token"},"iss":{"type":"string","description":"Issuer of the token"},"jti":{"type":"string","description":"JWT ID"}},"required":["active"]}}}},"400":{"description":"Invalid request or error response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"error_uri":{"type":"string"}},"required":["error"]}}}},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/revoke":{"post":{"tags":["Oauth-provider"],"description":"Revoke an OAuth2 access or refresh token","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string","description":"OAuth2 client ID"},"client_secret":{"type":"string","description":"OAuth2 client secret"},"token":{"type":"string","description":"The token to revoke (access or refresh token)"},"token_type_hint":{"type":"string","description":"Hint about the token type. Recognized values: `access_token`, `refresh_token`."}},"required":["token"]}}}},"responses":{"200":{"description":"Token revoked successfully. The response body is empty.","content":{"application/json":{"schema":{"type":"object","description":"Empty object on success"}}}},"400":{"description":"Invalid request or error response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"error_uri":{"type":"string"}},"required":["error"]}}}},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/userinfo":{"get":{"tags":["Oauth-provider"],"description":"Get OpenID Connect user information (UserInfo endpoint)","security":[{"bearerAuth":[]}],"parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"type":"string"},"description":"Bearer or DPoP access token"},{"name":"DPoP","in":"header","required":false,"schema":{"type":"string"},"description":"RFC 9449 DPoP proof JWT when using a DPoP-bound access token"}],"responses":{"200":{"description":"User information retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"sub":{"type":"string","description":"Subject identifier (user ID)"},"email":{"type":"string","format":"email","nullable":true,"description":"User's email address, included if 'email' scope is granted"},"name":{"type":"string","nullable":true,"description":"User's full name, included if 'profile' scope is granted"},"picture":{"type":"string","format":"uri","nullable":true,"description":"User's profile picture URL, included if 'profile' scope is granted"},"given_name":{"type":"string","nullable":true,"description":"User's given name, included if 'profile' scope is granted"},"family_name":{"type":"string","nullable":true,"description":"User's family name, included if 'profile' scope is granted"},"email_verified":{"type":"boolean","nullable":true,"description":"Whether the email is verified, included if 'email' scope is granted"}},"required":["sub"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"description":"Unauthorized - invalid or missing access token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden - insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}},"post":{"tags":["Oauth-provider"],"description":"Get OpenID Connect user information (UserInfo endpoint)","security":[{"bearerAuth":[]}],"parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"type":"string"},"description":"Bearer or DPoP access token"},{"name":"DPoP","in":"header","required":false,"schema":{"type":"string"},"description":"RFC 9449 DPoP proof JWT when using a DPoP-bound access token"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string"}}}}}},"responses":{"200":{"description":"User information retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"sub":{"type":"string","description":"Subject identifier (user ID)"},"email":{"type":"string","format":"email","nullable":true,"description":"User's email address, included if 'email' scope is granted"},"name":{"type":"string","nullable":true,"description":"User's full name, included if 'profile' scope is granted"},"picture":{"type":"string","format":"uri","nullable":true,"description":"User's profile picture URL, included if 'profile' scope is granted"},"given_name":{"type":"string","nullable":true,"description":"User's given name, included if 'profile' scope is granted"},"family_name":{"type":"string","nullable":true,"description":"User's family name, included if 'profile' scope is granted"},"email_verified":{"type":"boolean","nullable":true,"description":"Whether the email is verified, included if 'email' scope is granted"}},"required":["sub"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"description":"Unauthorized - invalid or missing access token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden - insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/end-session":{"get":{"tags":["Oauth-provider"],"description":"RP-Initiated Logout endpoint. Accepts standard logout parameters through GET or an application/x-www-form-urlencoded POST body, plus JSON for Better Auth generated-client calls. Requests without a usable id_token_hint may require explicit OP confirmation.","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Logout completed, or an HTML confirmation page was returned for browser navigation. A redirect is used only for an exact registered post_logout_redirect_uri.","content":{"application/json":{"schema":{"type":"object","properties":{"redirect_uri":{"type":"string","format":"uri","description":"URI to redirect to after logout (if post_logout_redirect_uri was provided)"},"message":{"type":"string","description":"Success message"}}}},"text/html":{"schema":{"type":"string"}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}},"post":{"tags":["Oauth-provider"],"description":"RP-Initiated Logout endpoint. Accepts standard logout parameters through GET or an application/x-www-form-urlencoded POST body, plus JSON for Better Auth generated-client calls. Requests without a usable id_token_hint may require explicit OP confirmation.","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"id_token_hint":{"type":"string"},"client_id":{"type":"string"},"post_logout_redirect_uri":{"type":"string"},"state":{"type":"string"}}}}}},"responses":{"200":{"description":"Logout completed, or an HTML confirmation page was returned for browser navigation. A redirect is used only for an exact registered post_logout_redirect_uri.","content":{"application/json":{"schema":{"type":"object","properties":{"redirect_uri":{"type":"string","format":"uri","description":"URI to redirect to after logout (if post_logout_redirect_uri was provided)"},"message":{"type":"string","description":"Success message"}}}},"text/html":{"schema":{"type":"string"}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/end-session/confirm":{"post":{"tags":["Oauth-provider"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"enum":["confirm"]}},"required":["action"]}}}},"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/register":{"post":{"tags":["Oauth-provider"],"description":"Register an OAuth2 application","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"redirect_uris":{"type":"array","items":{"type":"string"}},"scope":{"type":"string"},"client_name":{"type":"string"},"client_uri":{"type":"string"},"logo_uri":{"type":"string"},"contacts":{"type":"array","items":{"type":"string","minLength":1}},"tos_uri":{"type":"string"},"policy_uri":{"type":"string"},"software_id":{"type":"string"},"software_version":{"type":"string"},"software_statement":{"type":"string"},"post_logout_redirect_uris":{"type":"array","items":{"type":"string"}},"backchannel_logout_uri":{"type":"string"},"backchannel_logout_session_required":{"type":"boolean"},"token_endpoint_auth_method":{"type":"string","minLength":1},"jwks":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["keys"]},"jwks_uri":{"type":"string"},"grant_types":{"type":"array","items":{"type":"string","minLength":1}},"response_types":{"type":"array","items":{"type":"string","enum":["code"]}},"application_type":{"type":"string","enum":["web","native"]},"subject_type":{"type":"string","enum":["public","pairwise"]},"dpop_bound_access_tokens":{"type":"boolean"},"resources":{"type":"array","items":{"type":"string"}},"skip_consent":{"type":"string"}}}}}},"responses":{"201":{"description":"OAuth2 application registered successfully","content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string","description":"Unique identifier for the client"},"client_secret":{"type":"string","description":"Secret key for the client"},"client_secret_expires_at":{"type":"number","description":"Time the client secret will expire. If 0, the client secret will never expire."},"scope":{"type":"string","description":"Space-separated scopes allowed by the client"},"user_id":{"type":"string","description":"ID of the user who registered the client, null if registered anonymously"},"client_id_issued_at":{"type":"number","description":"Creation timestamp of this client"},"client_name":{"type":"string","description":"Name of the OAuth2 application"},"client_uri":{"type":"string","description":"Name of the OAuth2 application"},"logo_uri":{"type":"string","description":"Icon URL for the application"},"contacts":{"type":"array","items":{"type":"string"},"description":"List representing ways to contact people responsible for this client, typically email addresses"},"tos_uri":{"type":"string","description":"Client's terms of service uri"},"policy_uri":{"type":"string","description":"Client's policy uri"},"software_id":{"type":"string","description":"Unique identifier assigned by the developer to help in the dynamic registration process"},"software_version":{"type":"string","description":"Version identifier for the software_id"},"software_statement":{"type":"string","description":"JWT containing metadata values about the client software as claims"},"redirect_uris":{"type":"array","items":{"type":"string","format":"uri"},"description":"List of allowed redirect uris"},"post_logout_redirect_uris":{"type":"array","items":{"type":"string","format":"uri"},"description":"List of allowed logout redirect uris"},"backchannel_logout_uri":{"type":"string","format":"uri","description":"RP URL to receive signed Logout Tokens when the end-user's OP session terminates"},"backchannel_logout_session_required":{"type":"boolean","description":"Whether the RP requires a `sid` claim in every Logout Token"},"token_endpoint_auth_method":{"type":"string","description":"Requested authentication method for the token endpoint"},"grant_types":{"type":"array","items":{"type":"string"},"description":"Grant types the client may use at the token endpoint"},"response_types":{"type":"array","items":{"type":"string","enum":["code"]},"description":"Response types the client may use at the authorization endpoint"},"application_type":{"type":"string","description":"OIDC application type used to classify redirect URI policy","enum":["web","native"]},"resources":{"type":"array","items":{"type":"string","format":"uri"},"description":"Final resource identifiers linked to the registered client"},"disabled":{"type":"boolean","description":"Whether the client is disabled"}},"required":["client_id"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/create-client":{"post":{"tags":["Oauth-provider"],"description":"Register an OAuth2 application","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"redirect_uris":{"type":"array","items":{"type":"string"}},"scope":{"type":"string"},"client_name":{"type":"string"},"client_uri":{"type":"string"},"logo_uri":{"type":"string"},"contacts":{"type":"array","items":{"type":"string","minLength":1}},"tos_uri":{"type":"string"},"policy_uri":{"type":"string"},"software_id":{"type":"string"},"software_version":{"type":"string"},"software_statement":{"type":"string"},"post_logout_redirect_uris":{"type":"array","items":{"type":"string"}},"backchannel_logout_uri":{"type":"string"},"backchannel_logout_session_required":{"type":"boolean"},"token_endpoint_auth_method":{"type":"string","minLength":1},"application_type":{"type":"string","enum":["web","native"]},"jwks":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["keys"]},"jwks_uri":{"type":"string"},"grant_types":{"type":"array","items":{"type":"string","minLength":1}},"response_types":{"type":"array","items":{"type":"string","enum":["code"]}},"dpop_bound_access_tokens":{"type":"boolean"}}}}}},"responses":{"201":{"description":"OAuth2 application registered successfully","content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string","description":"Unique identifier for the client"},"client_secret":{"type":"string","description":"Secret key for the client"},"client_secret_expires_at":{"type":"number","description":"Time the client secret will expire. If 0, the client secret will never expire."},"scope":{"type":"string","description":"Space-separated scopes allowed by the client"},"user_id":{"type":"string","description":"ID of the user who registered the client, null if registered anonymously"},"client_id_issued_at":{"type":"number","description":"Creation timestamp of this client"},"client_name":{"type":"string","description":"Name of the OAuth2 application"},"client_uri":{"type":"string","description":"URI of the OAuth2 application"},"logo_uri":{"type":"string","description":"Icon URI for the application"},"contacts":{"type":"array","items":{"type":"string"},"description":"List representing ways to contact people responsible for this client, typically email addresses"},"tos_uri":{"type":"string","description":"Client's terms of service uri"},"policy_uri":{"type":"string","description":"Client's policy uri"},"software_id":{"type":"string","description":"Unique identifier assigned by the developer to help in the dynamic registration process"},"software_version":{"type":"string","description":"Version identifier for the software_id"},"software_statement":{"type":"string","description":"JWT containing metadata values about the client software as claims"},"redirect_uris":{"type":"array","items":{"type":"string","format":"uri"},"description":"List of allowed redirect uris"},"token_endpoint_auth_method":{"type":"string","description":"Requested authentication method for the token endpoint"},"grant_types":{"type":"array","items":{"type":"string"},"description":"Grant types the client may use at the token endpoint"},"response_types":{"type":"array","items":{"type":"string","enum":["code"]},"description":"Response types the client may use at the authorization endpoint"},"application_type":{"type":"string","description":"OIDC application type used to classify redirect URI policy","enum":["web","native"]},"resources":{"type":"array","items":{"type":"string","format":"uri"},"description":"Final server-owned resources linked to the client"},"disabled":{"type":"boolean","description":"Whether the client is disabled"},"metadata":{"type":"object","additionalProperties":true,"nullable":true,"description":"Additional metadata for the application"}},"required":["client_id"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/get-client":{"get":{"tags":["Oauth-provider"],"description":"Get OAuth2 formatted client details","security":[{"bearerAuth":[]}],"parameters":[{"name":"client_id","in":"query","schema":{"type":"string"}}],"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/public-client":{"get":{"tags":["Oauth-provider"],"description":"Gets publicly available client fields","security":[{"bearerAuth":[]}],"parameters":[{"name":"client_id","in":"query","schema":{"type":"string"}}],"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/public-client-prelogin":{"post":{"tags":["Oauth-provider"],"description":"Gets publicly available client fields (prior to login)","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string"},"oauth_query":{"type":"string"}},"required":["client_id"]}}}},"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/get-clients":{"get":{"tags":["Oauth-provider"],"description":"Get OAuth2 formatted client details for a user or organization","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/update-client":{"post":{"tags":["Oauth-provider"],"description":"Updates OAuth2 formatted client details.","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string"},"update":{"type":"object","properties":{"redirect_uris":{"type":"array","items":{"type":"string"}},"scope":{"type":"string"},"client_name":{"type":"string"},"client_uri":{"type":"string"},"logo_uri":{"type":"string"},"contacts":{"type":"array","items":{"type":"string","minLength":1}},"tos_uri":{"type":"string"},"policy_uri":{"type":"string"},"software_id":{"type":"string"},"software_version":{"type":"string"},"software_statement":{"type":"string"},"post_logout_redirect_uris":{"type":"array","items":{"type":"string"}},"backchannel_logout_uri":{"type":"string"},"backchannel_logout_session_required":{"type":"boolean"},"application_type":{"type":"string","enum":["web","native"]},"grant_types":{"type":"array","items":{"type":"string","minLength":1}},"response_types":{"type":"array","items":{"type":"string","enum":["code"]}}}}},"required":["client_id","update"]}}}},"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/client/rotate-secret":{"post":{"tags":["Oauth-provider"],"description":"Rotates a confidential client's secret","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string"}},"required":["client_id"]}}}},"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/delete-client":{"post":{"tags":["Oauth-provider"],"description":"Deletes an oauth client","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string"}},"required":["client_id"]}}}},"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/get-consent":{"get":{"tags":["Oauth-provider"],"description":"Gets details of a specific OAuth2 consent for a user","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"query","schema":{"type":"string"}}],"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/get-consents":{"get":{"tags":["Oauth-provider"],"description":"Gets all available OAuth2 consents for a user","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/update-consent":{"post":{"tags":["Oauth-provider"],"description":"Updates consent granted to a client.","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"update":{"type":"object","properties":{"scopes":{"type":"array","items":{"type":"string"}}},"required":["scopes"]}},"required":["id","update"]}}}},"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/oauth2/delete-consent":{"post":{"tags":["Oauth-provider"],"description":"Deletes consent granted to a client","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"responses":{"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/invite/create":{"post":{"tags":["Invite"],"description":"Create an invitation","operationId":"createInvitation","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","description":"The role to give the invited user"},"email":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"tokenType":{"type":"string","enum":["token","code","custom"],"description":"Type of token tu use, 24 character token, 6 digit code or custom options.generateToken"},"redirectToSignUp":{"type":"string","description":"The URL to redirect the user to create their account. If the token isn't valid or expired, it'll be redirected with a query parameter `?error=INVALID_TOKEN`. If the token is valid, it'll be redirected with a query parameter `?token=VALID_TOKEN"},"redirectToSignIn":{"type":"string","description":"The URL to redirect the user to upgrade their role."},"maxUses":{"type":"number","description":"The number of times an invitation can be used"},"expiresIn":{"type":"number","description":"Number of seconds the invitation token is valid for."},"redirectToAfterUpgrade":{"type":"string","description":"The URL to redirect the user to after upgrade their role (if the user is already logged in)"},"shareInviterName":{"type":"boolean","description":"Whether the inviter's name should be shared with the invitee"},"senderResponse":{"type":"string","enum":["token","url"],"description":"How should the sender receive the token (sender only receives a token if no email is provided)"},"senderResponseRedirect":{"type":"string","enum":["signUp","signIn"],"description":"Where should we redirect the user? (only if no email is provided)"},"customInviteUrl":{"type":"string","description":"The user will be redirected here to activate their invite"}},"required":["role"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/invite/activate":{"post":{"tags":["Invite"],"description":"Redirects the user to the callback URL with the token in a cookie","operationId":"activateInvite","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"callbackURL":{"type":"string","description":"Where to redirect the user after sing in/up"},"token":{"type":"string","description":"The invite token"}},"required":["token"]}}}},"responses":{"200":{"description":"Invite activated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","example":true},"message":{"type":"string","example":"Invite activated successfully"},"action":{"type":"string","example":"SIGN_IN_UP_REQUIRED"},"redirectTo":{"type":"string","example":"/auth/sign-in"}},"required":["status","message"]}}}},"400":{"description":"Invalid or expired invite token","content":{"application/json":{"schema":{"type":"object","properties":{"errorCode":{"type":"string","example":"INVALID_TOKEN"},"message":{"type":"string"}}}}}},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"description":"Internal server error"}}}},"/invite/{token}":{"get":{"tags":["Invite"],"description":"Redirects the user to the callback URL with the token in a cookie. If an error occurs, the user is redirected to the callback URL with the query parameters 'error' and 'message'.","operationId":"activateInviteCallback","security":[{"bearerAuth":[]}],"parameters":[{"name":"token","in":"path","required":true,"description":"The invitation token","schema":{"type":"string"}},{"name":"callbackURL","in":"query","required":true,"description":"Where to redirect the user after sing in/up","schema":{"type":"string"}}],"responses":{"302":{"description":"Redirects the user to the callback URL. On error, includes 'error' and 'message' query parameters.","headers":{"Location":{"description":"Redirect destination","schema":{"type":"string"}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/invite/cancel":{"post":{"tags":["Invite"],"description":"Cancel an invitation. Only the user that created the invite can cancel it.","operationId":"cancelInvite","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"The invite token to cancel."}},"required":["token"]}}}},"responses":{"200":{"description":"Invite cancelled successfully","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","example":true},"message":{"type":"string","example":"Invite cancelled successfully"}},"required":["status","message"]}}}},"400":{"description":"Invalid token or user does not have permission to cancel this invite","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"errorCode":{"type":"string"}}}}}},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/invite/get":{"get":{"tags":["Invite"],"description":"Get basic information about an invitation, including inviter details. For private invites, the requester must match the invite email.","operationId":"getInvite","security":[{"bearerAuth":[]}],"parameters":[{"name":"token","in":"query","schema":{"type":"string","description":"The invite token to look up."}}],"responses":{"200":{"description":"Invite found","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","example":true},"inviter":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string","nullable":true},"image":{"type":"string","nullable":true}}},"invitation":{"type":"object","properties":{"email":{"type":"string","nullable":true},"emails":{"type":"string[]"},"createdAt":{"type":"string","format":"date-time"},"role":{"type":"string"},"newAccount":{"type":"boolean"}}}},"required":["status","inviter","invitation"]}}}},"400":{"description":"Invalid or non-existent invite token","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"errorCode":{"type":"string"}}}}}},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/invite/reject":{"post":{"tags":["Invite"],"description":"Reject an invitation. Only available for private invites. Only the invitee (user whose email matches the invite for private invites) can reject it.","operationId":"rejectInvite","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"The invite token to reject."}},"required":["token"]}}}},"responses":{"200":{"description":"Invite rejected successfully","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","example":true},"message":{"type":"string","example":"Invite rejected successfully"}},"required":["status","message"]}}}},"400":{"description":"Invalid token or user does not have permission to reject this invite","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"errorCode":{"type":"string"}}}}}},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}},"/invite/list":{"get":{"tags":["Invite"],"description":"List all (private) invitations for the current user.","operationId":"listInvites","security":[{"bearerAuth":[]}],"parameters":[{"name":"searchValue","in":"query","schema":{"type":"string","description":"The value to search for."}},{"name":"searchField","in":"query","schema":{"type":"string","enum":["name","email","domainWhitelist"],"description":"The field to search in, defaults to email. Can be `email`, `name` or `domainWhitelist`."}},{"name":"searchOperator","in":"query","schema":{"type":"string","enum":["contains","starts_with","ends_with"],"description":"The operator to use for the search. Can be `contains`, `starts_with` or `ends_with`."}},{"name":"limit","in":"query","schema":{"type":"number","description":"The numbers of invitations to return."}},{"name":"offset","in":"query","schema":{"type":"number","description":"The offset to start from."}},{"name":"sortBy","in":"query","schema":{"type":"string","description":"The field to sort by."}},{"name":"sortDirection","in":"query","schema":{"type":"string","enum":["asc","desc"],"description":"The direction to sort by."}},{"name":"filterField","in":"query","schema":{"type":"string","description":"The field to filter by."}},{"name":"filterValue","in":"query","schema":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"}]},{"type":"boolean"}],"description":"The value to filter by."}},{"name":"filterOperator","in":"query","schema":{"type":"string","enum":["eq","ne","lt","lte","gt","gte"],"description":"The operator to use for the filter."}}],"responses":{"200":{"description":"List of all issued invitations","content":{"application/json":{"schema":{"type":"object","properties":{"invitations":{"type":"array","items":{"$ref":"#/components/schemas/InviteType"}},"total":{"type":"number"},"limit":{"type":["number","undefined"]},"offset":{"type":["number","undefined"]}}}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Bad Request. Usually due to missing parameters, or invalid parameters."},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"description":"Unauthorized. Due to missing or invalid authentication."},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Forbidden. You do not have permission to access this resource or to perform this action."},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Not Found. The requested resource was not found."},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Too Many Requests. You have exceeded the rate limit. Try again later."},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}},"description":"Internal Server Error. This is a problem with the server that you cannot fix."}}}}}}