> For the complete documentation index, see [llms.txt](https://docs.settle.africa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.settle.africa/authentication.md).

# Authentication

{% hint style="info" %}
**Good to know:** All requests require authentication.
{% endhint %}

## Get your API keys

Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error.

You can generate an API key from your Dashboard at any time.

## Make the Authentication request

Send an authentication request to the login endpoint. This will create a `token, id and expiry` which will form the headers of any  request for the time until the expiry time passed.

{% hint style="info" %}
**Endpoint:** <https://settle.com/login>
{% endhint %}

Take a look at how you might call this method using `Http`:

{% tabs %}
{% tab title="Request" %}

```json
POST http://settle.africa/login  HTTP/1.1
Content-Type: application/json
{  
    "id":"1234567890",
    "password":"jumairah"
}

```

{% endtab %}

{% tab title="Success" %}

```json
{
  "status": "success",
  "data": {
    "token":"tegdghh66353l",
    "id":"5563678883",
    "expiry":"29/11/2024 12:23:23"
    },
  "message": "Login Successfully",
  "code": 0
}
```

{% endtab %}

{% tab title="Failed" %}

```json
{
  "status": "failed",
  "data": {},
  "message": "User does not exist",
  "code": 1
}
```

{% endtab %}
{% endtabs %}

Subsequent requests to the API will contain the Authenticated headers as follows:

```
id: 5563678883
token: tegdghh66353l
expiry: 29/11/2024 12:23:23
```

Authenticated Requests will look like:

```
GET http://settle.africa/profile  HTTP/1.1
id: 5563678883
token: tegdghh66353l
expiry: 29/11/2024 12:23:23
Content-Type: application/json

{  
}

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.settle.africa/authentication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
