Authentication and permissions
How to send your API key, what each permission allows, and what each access error means.
Every request carries one of your dealership's API keys. The key only sees and changes your dealership's data: there's no parameter to pick another one.
Sending the key
Use either of these:
x-cliquealo-api-key: clq_v1_…Authorization: Bearer clq_v1_…Permissions
You choose a key's permissions when you create it. A route without its permission responds 403.
| Permission | What it allows | Routes |
|---|---|---|
inventario:leer | Read your published cars | GET /inventario, GET /inventario/{slug} |
inventario:escribir | Add, change, and archive cars | POST /inventario, PUT and DELETE /inventario/{slug} |
catalogo:leer | Read the catalog | GET /catalogo/* |
cotizaciones:crear | See your loan products and quote | GET /cotizaciones/productos, POST /cotizaciones |
plataformas:reportar | Report and look up other platforms | GET and POST /inventario/{slug}/publicaciones |
You see which permissions your plan includes and how many keys you can have in the console, under «Uso» ("Usage").
Access errors
| Status | codigo | What happened | What to do |
|---|---|---|---|
| 401 | sin_credencial | No key arrived | Send one of the two headers |
| 401 | credencial_invalida | The key doesn't exist, was revoked, or the dealership isn't active | Create another one in the console |
| 403 | permiso_faltante | The key lacks the route's permission; scope says which | Create a key with that permission |
| 403 | scope_no_incluido | Your plan doesn't include that permission | Change plans |
| 403 | sin_agencia | The route needs a dealership key | Use a key created in the console |
| 503 | no_disponible | The API is briefly unavailable | Retry in a few minutes |
Taking care of your key
- Use it only from your server. If it reaches someone's browser, anyone can read or change your inventory.
- If you suspect someone else has it, revoke it in the console: it stops working on the next request.
- Use a different key for each system, with only the permissions it needs, so you can revoke one without affecting the rest.