Also available: Markdown version · llms.txt · full site content
Authentication
Email and password
POST /auth/v1/signup creates a user and returns a session. Sign in later with the password grant; the access token is the JWT for your Data API calls.
Sign up
POST https://example-project.api.cubibase.com/auth/v1/signup
apikey: cb_pub_EXAMPLE_ONLY
Content-Type: application/json
{
"email": "mina@example.com",
"password": "<USER_PASSWORD>"
}{
"user": {
"id": "3f2b8c1e-9a47-4d02-b6e5-1c8f0a3d7e29",
"email": "mina@example.com",
"emailVerifiedAt": "2026-11-18T09:12:44.000Z",
"providers": ["email"],
"mfaEnabled": false
},
"accessToken": "<ACCESS_JWT>",
"refreshToken": "<REFRESH_TOKEN>",
"tokenType": "Bearer",
"expiresIn": 3600
}- The password must meet the project’s minimum length — 8 characters by default — and must not equal the email address.
- An optional
dataobject is stored as the user’s metadata. - The response carries the
user, anaccessToken, arefreshToken, and the expiry. - A duplicate email returns
409 user_exists.
Sign in
POST https://example-project.api.cubibase.com/auth/v1/token?grant_type=password
apikey: cb_pub_EXAMPLE_ONLY
Content-Type: application/json
{
"email": "mina@example.com",
"password": "<USER_PASSWORD>"
}A correct email and password return the same session shape as signup. Wrong credentials return 401 invalid_credentials — the same error whether the email exists or not.
Using the session
- Store the
refreshTokensafely on the client. - Send the
accessTokenasAuthorization: Bearer …on Data API calls. - When it expires (1 hour by default), refresh with
grant_type=refresh_tokenand store the new pair. - On sign-out,
POST /auth/v1/logoutwith the refresh token revokes the session.
POST https://example-project.api.cubibase.com/auth/v1/token?grant_type=refresh_token
apikey: cb_pub_EXAMPLE_ONLY
Content-Type: application/json
{
"refreshToken": "<REFRESH_TOKEN>"
}Read and update the user
GET /auth/v1/user returns the signed-in user from the bearer token. PATCH /auth/v1/user updates the password or metadata (and converts anonymous users — see Anonymous users).
GET https://example-project.api.cubibase.com/auth/v1/user
apikey: cb_pub_EXAMPLE_ONLY
Authorization: Bearer <ACCESS_JWT>