> ## Documentation Index
> Fetch the complete documentation index at: https://docs.talview.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Standard Talview Authentication

Every API request to Talview needs to be authenticated by passing the `access_token` received with the response of the below-mentioned login API.

**Request header definition:**

| Method       | POST                                               |
| :----------- | :------------------------------------------------- |
| **Host**     | [https://api.talview.com](https://api.talview.com) |
| Route        | /api/rest/auth\_user\_login                        |
| Content type | application/json                                   |

**Request payload definition:**

| Attribute  | Data Type | Mandatory | Description                                                                          |
| :--------- | :-------- | :-------- | :----------------------------------------------------------------------------------- |
| username   | String    | Yes       | API username that will be shared by Talview                                          |
| password   | String    | Yes       | API password that will be shared by Talview                                          |
| tenant\_id | Integer   | Yes       | Tenant identifier for each of the organization on Talview, will be shared by Talview |

**Sample request payload:**

```text theme={null}
{
  "username": "username@talview.com",
  "password": "secure_password",
  "tenant_id": 1
}
```

**Sample response payload:**

1. Success response: HTTP status code - 201
   ```text theme={null}
   {
     "auth_user_login": {
       "success": true,
       "error_message": null,
       "data": {
         "access_token": "<:jwt_token:>",
         "expires_in": 1715077045,
         "refresh_token": "<:refresh_token:>"
       }
     }
   }
   ```
2. Error Response: HTTP status code - 401
   ```text theme={null}
   {
     "error": "Wrong username/password"
   }
   ```

**Sample CURL request:**

```bash theme={null}
curl --request POST \\
  --url https://supergraph.talview.com/api/rest/auth_user_login \\
  --data '{  
  "username": "username@talview.com",
  "password": "secure_password",
  "tenant_id": 1
}'
```
