# Login

> <mark style="color:red;">PREMIUM ENDPOINT</mark>

## Returns a session\_key to interact with tiktok

<mark style="color:blue;">`GET`</mark> `https://kitkot.xyz/api/login`

Returns a `session_key` which is needed to use any of our account endpoints.

#### Query Parameters

| Name                                       | Type   | Description                                      |
| ------------------------------------------ | ------ | ------------------------------------------------ |
| username                                   | String | The username of the account to login to          |
| password<mark style="color:red;">\*</mark> | String | The password of the account to login to          |
| api\_key<mark style="color:red;">\*</mark> | String | The api\_key you got when purchasing our service |
| email                                      | String | The email of the account to login to             |

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

```json
{
  "code": 200,
  "session_key": "THWgf20JmQKiCT7FD_4s5_Nj1V2TZq9L",
  "msg": "Session will be active in 60 seconds, do not use this session key before that."
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="NodeJS" %}
{% code overflow="wrap" lineNumbers="true" %}

```javascript
const fetch = require('node-fetch');

const BASEURL = "https://kitkot.xyz/api";
const API_KEY = "my-api-key";
const username = "kitkot";
const password = "KitKot123!";

const request = await fetch(`${BASEURL}/login?api_key=${API_KEY}&username=${username}&password=${password}`);
const response = await request.json();
console.log(response);
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}
{% code overflow="wrap" lineNumbers="true" %}

```python
import requests

BASEURL = "https://kitkot.xyz/api"
API_KEY = "my-api-key"
username = "kitkot"
password = "KitKot123"

request = requests.get(f"{BASEURL}/login?api_key={API_KEY}&username={username}&password={password}")
response = request.json()
print(response)
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
[This page shows what to do after you have received a session\_key as response](https://kitkot-io-organization.gitbook.io/kitkot-api-documentation/kitkot/session)
{% endhint %}
