Authentication
Exchange an API key for a JWT access token and use it on every request.
The API uses a two-step process: an API key proves who you are once, and a short-lived JWT token proves it on every request after that.
Info
API keys are long-lived credentials and should be stored securely. JWT tokens expire after 24 hours and need to be refreshed.
#Creating an API key
- Log in to the dashboard
- Navigate to Settings from the sidebar
- Click on Integrations
- Click Create API Key
- Enter a name for your key (for example, "Production API Key")
- Copy and securely store the generated key
#Exchanging the key for a token
POST /api-auth/authenticate is the only endpoint that does not require the Authorization header. It exchanges an API key for a JWT access token valid for 24 hours.
{
"apiKey": "string"
}curl -X POST https://api.up2data.ai/api/api-auth/authenticate \
-H "Content-Type: application/json" \
-d '{"apiKey": "your-api-key-here"}'A successful exchange returns the token:
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}An invalid key returns 401:
{
"error": "Not authorized"
}#Using the access token
Every other endpoint requires the token in the Authorization header:
Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Warning
Tokens expire after 24 hours and need to be refreshed; re-run the exchange with your API key to get a new one.