> For the complete documentation index, see [llms.txt](https://docs.hiboo.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hiboo.io/rest-api-reference/login.md).

# Login

Exchange the name and API key of your API credential for a token, valid for 10 days. Send this token with every other request, in the `x-access-token` header.

## Authenticate on the API

> Authenticate on the API with your credentials to get a token that you can use in your requests. The token is valid for 10 days.

```json
{"openapi":"3.0.3","info":{"title":"Hiboo API","version":"2.0.0"},"tags":[{"name":"Login","description":"Exchange the name and API key of your API credential for a token, valid for 10 days. Send this token with every other request, in the `x-access-token` header."}],"servers":[{"url":"https://api.hiboo.io","description":"Production server"},{"url":"https://api-sandbox.hiboo.io","description":"Sandbox server"}],"security":[],"paths":{"/login":{"post":{"operationId":"login","summary":"Authenticate on the API","description":"Authenticate on the API with your credentials to get a token that you can use in your requests. The token is valid for 10 days.","tags":["Login"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","apiKey"],"properties":{"name":{"type":"string"},"apiKey":{"type":"string"}}}}}},"responses":{"200":{"description":"Token to use in the other API calls","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"email":{"type":"string"},"admin":{"type":"boolean"},"firstName":{"type":"string"},"lastName":{"type":"string"},"token":{"type":"string"}}}}}},"401":{"description":"The name or the API key is wrong, or the API credential is deactivated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoDetailError"}}}}}}}},"components":{"schemas":{"NoDetailError":{"required":["message"],"type":"object","properties":{"message":{"type":"string","description":"A human readable description of the error"}}}}}}
```
