Authorization header of your HTTP requests.
Overview
- Register an account.
- Login to obtain an access token.
- Include the token in your requests.
- Refresh the token when it expires (every 7 days).
Registration
To start using the API, you need to create an account. You can do this via the/auth/register endpoint.
You will need a valid email address.
Getting an Access Token
After registering, exchange your credentials for an access token using the/auth/token endpoint.
Using the Token
Include the token in theAuthorization header of your requests:
Example Request
Token Lifetime & Refreshing
Access tokens do not expire. When your token expires, the API will return a401 Unauthorized error. To “refresh” your token, simply call the /auth/token endpoint again with your credentials to get a new token.
Security Best Practices
- Environment Variables: Store your tokens in environment variables (e.g.,
SUNBIRD_API_TOKEN). - Backend Proxy: If you are building a frontend application, route requests through your own backend to keep your credentials hidden. Do not expose your token in client-side code.
OAuth Integration
We support Google OAuth for easier login. This is primarily handled via our web interface, but the underlying flow uses standard OAuth 2.0 protocols.Common Errors
| Status Code | Error | Description |
|---|---|---|
401 | Unauthorized | The token is missing, invalid, or expired. |
403 | Forbidden | You do not have permission to access this resource. |

