Every Riven API endpoint (exceptDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/rivenmedia/riven/llms.txt
Use this file to discover all available pages before exploring further.
GET /api/v1/) requires a valid API key. The key is stored in AppModel.api_key inside Riven’s settings file and is checked on every incoming request. You can generate a new key at any time without restarting the server.
How authentication works
Riven’sresolve_api_key dependency accepts a key through any one of three mechanisms and rejects the request with 401 Unauthorized if none of them supply the correct value.
| Method | Where to send the key |
|---|---|
x-api-key header | x-api-key: YOUR_KEY |
| Bearer token | Authorization: Bearer YOUR_KEY |
| Query parameter | ?api_key=YOUR_KEY |
?api_key=YOUR_KEY) because browser WebSocket APIs cannot set arbitrary headers.
x-api-key header
The simplest and most common method for server-to-server calls.
Bearer token
Standard OAuth-styleAuthorization header — convenient when your HTTP client already handles Bearer auth.
Query parameter
Useful in browser contexts or when configuring webhooks that don’t support custom headers.WebSocket
WebSocket connections authenticate exclusively via theapi_key query parameter.
Generating a new API key
Send aPOST request to /api/v1/generateapikey. Riven generates a cryptographically random key, persists it to the settings file, and returns it in the response. The old key is immediately invalidated.
message is your new API key. Update every client that uses the old key before making further requests.
Error responses
When authentication fails, Riven returns401 Unauthorized with a JSON body:
- No API key is present in the request.
- The provided key does not match the stored key.
- A WebSocket connection supplies an incorrect
api_keyquery parameter.
Security recommendations
- Store your API key in an environment variable or secrets manager — never hard-code it in source control.
- Use the
x-api-keyheader (not the query parameter) for server-side calls so the key does not appear in server access logs. - Rotate the key immediately via
POST /api/v1/generateapikeyif it is ever exposed. - Restrict network access to port 8080 to trusted hosts at the firewall level; the API does not implement rate limiting.