Lens / Scrolloop Sentry

API and SDK surface

Conventions

• Base URL: http://localhost:4000 in development, https://api.sentry.scrolloop.com in production, with Swagger at /api-docs outside production.

• Tenant context comes from the hostname (custom domain or subdomain) or, on shared hosts, the X-Tenant-Slug header.

• Successful JSON is wrapped as { status, data }. Errors are RFC 9457 problem details (application/problem+json) with a stable code, a requestId and field errors for validation failures.

• Every response carries x-request-id; a client value is accepted only if it matches a strict pattern, otherwise a UUID replaces it.

• Auth endpoints are rate limited per route in Redis, with a retryAfterSeconds hint in the error body.

Endpoint families

• Authentication: /auth (login, refresh, logout, register, verify-email, magic-link send, preview, verify and poll, forgot and reset password, reauth, MFA verify and enrol) and /auth/social.

• MFA: /mfa for TOTP, backup codes, WebAuthn registration and authentication, and email OTP.

• OAuth and OIDC: /oauth/authorize, token, introspect, revoke, userinfo, end_session, plus /.well-known/openid-configuration and jwks.json.

• Identity and access: /users, /sessions, /rbac (roles, permissions, policies, groups, assignments).

• Tenancy: /tenants (register, slug-check, branding, allowed-origins, password-policy), /admin and /superadmin for platform operators, /dashboard and stats.

• Federation: /saml (sso, continue, metadata), /scim, /ldap/connections.

• Integration and compliance: /webhooks, /audit (list, CSV export, GDPR), /email, /health.

Webhook events

user.created, user.updated, user.deleted, user.login, login.failed, password.changed, mfa.enabled, mfa.disabled, session.revoked, role.assigned, role.removed, tenant.updated, and test.ping from a manual test. The envelope carries id, type, createdAt, tenantId and a data object with ids, the email already on the event and a short allow-list of metadata. Receivers verify the HMAC of the raw body and dedupe on the delivery id.

Stable error codes

Clients branch on codes rather than messages: VALIDATION_FAILED, RATE_LIMITED, AUTH_ACCOUNT_LOCKED (423), AUTH_MFA_REQUIRED, AUTH_TOKEN_INVALID, LINK_EXPIRED (410), LINK_ALREADY_USED (409) and LINK_WRONG_ACCOUNT (403). Link failures are designed to reveal nothing about whether an account exists.