Authentication
Every API call is signed with an API key, sent in the Authorization header.
The header
Put your secret key after the word Bearer:
GET /v2/{team_id}/project/{project_id}/upload/{upload_id} HTTP/1.1
Host: api.send.ai
Authorization: Bearer <your secret key>
The key must be linked to the project in the URL, and its scopes must allow the call. See API keys and scopes.
When a key is refused
A refused key gets one of these answers:
| Status | Message | Cause |
|---|---|---|
| 400 | Please use the correct header format | The Authorization header is missing or has no Bearer. |
| 403 | API key does not exist or is currently disabled | The key was deleted or disabled. |
| 403 | Invalid credentials | The secret is wrong. |
| 401 | Project with id '…' does not exist or the API Key does not have access to this project | The key is not linked to the project. |
| 403 | User has no permission to perform this action | The key lacks the scope for this call. |
Uploads answer in a shorter form, such as {"error":"unauthorized API KEY"}. See Errors.
Changes take a moment
Linking or unlinking a key, or disabling it, can take about 15 seconds to reach the upload endpoint.
Keeping keys safe
The secret key gives access to your projects, so keep it on your server. Do not put it in a website or an app that others can open; browsers cannot call the API anyway.