Getting Started
Base URL
API Version
All endpoints are prefixed with/api/v1:
Interactive Documentation
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- OpenAPI JSON: http://localhost:8000/openapi.json
Common Headers
Authentication
1. Register New Account
Create a new account with the first admin user. Endpoint:POST /api/v1/auth/register
Authentication: None (public endpoint)
Request:
Registration no longer returns tokens immediately. Email verification is REQUIRED before login.
- Minimum 12 characters
- At least one uppercase letter (A-Z)
- At least one lowercase letter (a-z)
- At least one digit (0-9)
- At least one special character:
!@#$%^&*()_+\-=\[\]{};':\"\\|,.<>\/?~
2. Login
Authenticate with email, password, and account identifier. Endpoint:POST /api/v1/auth/login
Authentication: None (public endpoint)
Request:
- Account slug:
"acme" - Account ID:
"AB1234"
account field is optional. If omitted, the default singleton account is used.
3. Refresh Token
Get a new access token using a refresh token. Endpoint:POST /api/v1/auth/refresh
Request:
4. Get Current User
Get information about the authenticated user. Endpoint:GET /api/v1/auth/me
Authentication: Required
Records (CRUD)
IMPORTANT: All record operations use/api/v1/records/{collection}.
Create Record
Endpoint: `POST /api/v1/records/{collection}“List Records
Endpoint:GET /api/v1/records/{collection}
Get Single Record
Endpoint:GET /api/v1/records/{collection}/{id}
Update Record (Full)
Endpoint:PUT /api/v1/records/{collection}/{id}
Update Record (Partial)
Endpoint:PATCH /api/v1/records/{collection}/{id}
Delete Record
Endpoint:DELETE /api/v1/records/{collection}/{id}
Collections
All collection endpoints require Superadmin access.Create Collection
Endpoint:POST /api/v1/collections/
Roles & Permissions
Create Role
Endpoint:POST /api/v1/roles
Update Collection Rules
Endpoint:PUT /api/v1/collections/{collection_name}/rules
Permission Rule Syntax
Users
All users endpoints require Superadmin access.Create User
Endpoint:POST /api/v1/users
List Users
Endpoint:GET /api/v1/users
OAuth Authentication
SnackBase supports OAuth 2.0 authentication for popular providers.Supported Providers
google- Google OAuth 2.0github- GitHub OAuth Appmicrosoft- Microsoft Azure ADapple- Sign in with Apple
Initiate OAuth Flow
Endpoint:POST /api/v1/auth/oauth/{provider_name}/authorize
SAML Authentication
SnackBase supports SAML 2.0 for enterprise single sign-on (SSO).Supported Providers
azure- Microsoft Azure ADokta- Okta Identity Cloudgeneric- Any SAML 2.0 compliant IdP
Initiate SAML SSO
Endpoint:GET /api/v1/auth/saml/sso
Download SAML Metadata
Endpoint:GET /api/v1/auth/saml/metadata