# Authentication

Base URL

```
sdk.faceki.com
```

### Token Generation End Point

```
https://sdk.faceki.com/auth/api/generate-token
```

Authentication for the Faceki API is achieved through token-based authentication. To authenticate requests made to the API, you must include an API token in the **Authorization** of your requests.

{% hint style="info" %}
Method: POST

Authorization: Bearer Token

**Body:**

&#x20;clientId  \*(mandatary)

&#x20;clientSecret   \*(mandatory)
{% endhint %}

<figure><img src="https://2740493135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa8ZQwB8n4moII834UHCv%2Fuploads%2FS76luW55VshetL1WQFsj%2FScreenshot%20from%202025-03-14%2015-20-55.png?alt=media&#x26;token=e4408e0f-7cf1-433a-b6a4-f7707bb8a8c5" alt=""><figcaption></figcaption></figure>

<mark style="color:blue;">`POST`</mark> `https://sdk.faceki.com/auth/api/generate-token`

#### Headers

| Name                                           | Type   | Description                                                                                                                                                                    |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| clientSecret<mark style="color:red;">\*</mark> | String | <p>clientSecret will be found in the integration section.</p><p> <em>Example: <code>"clientSecret":"00nl0cuq780ur007spqspa94kq6rkn1fap1e0kdre7gdl97lvspk".</code></em><br></p> |
| clientId<mark style="color:red;">\*</mark>     | String | <p>(string, required) Client Id from integration settings.</p><p> <em>Example: <code>"client\_id":"0NTS4CBV8MVII02VGVSPICB00"</code>.</em><br></p>                             |
| Content-Type                                   | String | application/json                                                                                                                                                               |

{% tabs %}
{% tab title="200: OK " %}

```json
    "responseCode": 0,
    "data": {
        "access_token": "<Your API Token>",
        "expires_in": 3600,
        "token_type": "Bearer"
    }
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
  "status": false,
  "message": "",
  "statusCode": 422,
  "data": {}
}
```

{% endtab %}

{% tab title="402 " %}

```javascript
{
  "clientSecret": ""
}
```

{% endtab %}

{% tab title="403 " %}

```javascript
{
  "status": false,
  "message": "client id is required",
  "statusCode": 422,
  "data": {}
}
```

{% endtab %}
{% endtabs %}

### <mark style="color:$danger;">Usage Policy:</mark>

* <mark style="color:$warning;">**Token Expiry:**</mark> <mark style="color:$warning;"></mark><mark style="color:$warning;">Tokens must be regenerated</mark> <mark style="color:$warning;"></mark><mark style="color:$warning;">**only after they expire**</mark><mark style="color:$warning;">. The</mark> <mark style="color:$warning;"></mark><mark style="color:$warning;">**default expiration time**</mark> <mark style="color:$warning;"></mark><mark style="color:$warning;">is</mark> <mark style="color:$warning;"></mark><mark style="color:$warning;">**3600 seconds (1 hour)**</mark><mark style="color:$warning;">.</mark>
* <mark style="color:$warning;">**Billing Notice:**</mark> <mark style="color:$warning;"></mark><mark style="color:$warning;">For</mark> <mark style="color:$warning;"></mark><mark style="color:$warning;">**high-volume requests**</mark><mark style="color:$warning;">,</mark> <mark style="color:$warning;"></mark><mark style="color:$warning;">**additional charges**</mark> <mark style="color:$warning;"></mark><mark style="color:$warning;">will apply based on the</mark> <mark style="color:$warning;"></mark><mark style="color:$warning;">**number of requests made per day**</mark><mark style="color:$warning;">.</mark>

<mark style="color:$danger;">Please ensure compliance to avoid service interruptions or unexpected billing.</mark>


---

# Agent Instructions: 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.faceki.com/api-integration/verification-apis/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.
