# 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>
