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

# Authentication

### **Authentication** <a href="#authentication" id="authentication"></a>

All API requests require authentication via OAuth 2.0 Bearer Token. The **client\_id** and **client\_secret** is unique to each customer and will be provided by the MadConnect technical team. Clients have to request a new token on expiry of the existing access token.

#### **Get Access Token** <a href="#get-access-token" id="get-access-token"></a>

```
POST /es/v2/oauth/client-token
```

**Request Body:**

```
{
  "clientId" : string,
  "clientSecret": string
}
```

**Response:**

```
{
   "accessToken": string,
   "tokenType": string,
   "expiry": 86400,  // in seconds
}
```

**Sample Curl:**

```
curl --location '<host>/es/v2/oauth/client-token' \
--header 'Content-Type: application/json' \
--data '{
  "clientId" : "sv1bF0b1dJ1e4chd",
  "clientSecret": "B3dbXd61f122Of3db9dP0Hd6d547da02"
}'
```

#### **Authentication Headers** <a href="#authentication-headers" id="authentication-headers"></a>

The access token should be passed in Authorization header as bearer token in each request to the MadConnect Embedded API.

```
Authorization: Bearer YOUR_ACCESS_TOKEN
```

####
