Developers
Company keys
Your company administrator issues a key in the portal, on the API keys page: they choose a name, the read permissions the key carries and how long it lasts, and confirm with their password. This needs a plan that includes API access.
The key is shown once, when it is issued. Store it safely; if it is lost, issue a new one and revoke the lost one.
A company can hold up to 10 live keys at once. A key lasts 30, 90, 180 or 365 days (90 by default) and stops working after that; the administrator can revoke it earlier at any time. A key with the webhook management permission lasts 30 or 90 days only, and at most 2 of them can be live.
Almost every permission a key can carry only reads, such as vehicles:read or orders:read. The one exception is platform:webhooks:manage, which looks after your webhook addresses and has rules of its own, described in the Webhooks guide. Each operation in the API reference names the permission it needs.
A key reads only what its owner could read in the portal, and only through the permissions it carries: both must allow it. A key whose owner is limited to one branch reads that branch only, and a record of another company or branch answers 404 as if it did not exist.
Send the key with every request in this header:
Authorization: Bearer <YOUR_COMPANY_KEY>
Requests must use HTTPS.
Reading lists
A list returns up to 200 records a page, 50 when you do not say, earliest first. When more follow, meta.page.next_cursor holds the cursor to send as the cursor parameter of the next request. The limit parameter sets the page size, and updated_since, a time in ISO 8601 with an offset, returns only what changed from then on.
curl -H "Authorization: Bearer <YOUR_COMPANY_KEY>" "https://tawasulone.com/api/v1/vehicles?limit=50"
Requests are limited per minute: by the allowance of your company's plan when it sets one, otherwise 120 a minute for each key owner. Going over the limit returns 429 with Retry-After, the seconds to wait.
A wrong, expired or revoked key returns 401. A key that lacks the permission an operation needs returns 403. A company whose plan has no API access is refused.