Ocipe’s API uses JSON Web Tokens (JWT) via SimpleJWT. Every protected endpoint requires a valid access token passed in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/viet2811/ocipe/llms.txt
Use this file to discover all available pages before exploring further.
Authorization header. Refresh tokens are stored in an HTTP-only cookie and automatically rotated — your client never sees the refresh token in a response body, and it is never exposed to JavaScript running on the page.
Register a new account
POST /api/user/register/
Creates a new user account. On success, the server also automatically provisions a personal Fridge and a GroceryList for the new user — no additional setup is required.
Request body
201 Created
400 Bad Request (username already taken)
Obtain tokens
POST /api/user/token/
Validates credentials and returns a short-lived access token in the response body. The refresh token is set as an HTTP-only cookie named refresh_token and is never included in the JSON body.
Request body
200 OK
The refresh token cookie is configured with
httponly=True, secure=True, and SameSite=None, with a max_age of 30 days (2,592,000 seconds). Because SameSite=None requires Secure, the cookie is only transmitted over HTTPS.Using the access token
Include the access token as a Bearer token in theAuthorization header of every request to a protected endpoint.
Refresh the access token
POST /api/user/token/refresh/
Issues a new access token. The server first looks for the refresh token in the refresh_token HTTP-only cookie. If the cookie is absent, you may supply the token explicitly in the request body.
Request body (optional — only needed if the cookie is not present)
200 OK
Logout
POST /api/user/logout/
Clears the refresh_token cookie by overwriting it with an empty string. After a successful logout, subsequent calls to /api/user/token/refresh/ will fail because the cookie no longer contains a valid token.
Example
Token lifecycle
| Token | Lifetime | Location | How to use |
|---|---|---|---|
| Access token | 5 minutes | JSON response body ("access") | Pass as Authorization: Bearer <token> on every protected request |
| Refresh token | 30 days | HTTP-only cookie (refresh_token) | Sent automatically by the browser, or via -b cookies.txt in curl; used only to obtain new access tokens from POST /api/user/token/refresh/ |