API keys
Send your key in the Authorization header on every request:
Authorization: Bearer upx_live_...Keys start with upx_live_ and are shown once, when you create them in the dashboard. UploadX stores only a hash, so a lost key cannot be recovered: create a new one and delete the old one.
Use one key per app or environment (for example production, staging and ci), so you can turn one off without touching the rest.
Keep keys on your server. A key in browser or mobile code can be read by anyone and used to upload to, or delete from, your account.
Check a key
GET /v1/meReturns the key the request was made with. Call it at startup so a bad key fails early, not on a user’s first upload.
curl https://api.uploadx.in/v1/me \
-H "Authorization: Bearer $UPLOADX_API_KEY"{ "id": "0b7c4f1e-2a9d-4e6b-8c3f-5d1a7e9b2c40", "name": "production" }| Field | Type | Description |
|---|---|---|
id |
string | The key’s ID |
name |
string | The name you gave the key when you made it |
Failed authentication
A missing, unknown or disabled key gets a 401:
{ "error": "unauthorized", "message": "Invalid or missing API key" }Retrying will not help. Check that the header is spelled Authorization, that the value starts with Bearer , and that the key is still enabled in the dashboard.
Disabling and deleting keys
In the dashboard’s API keys page you can:
- Disable a key. Requests with it fail with
401straight away, and you can enable it again later. - Delete a key. It stops working for good.
If a key leaks, disable it first, then create a replacement and roll it out.