# Getting a token

In order to access our API, you must obtain an access token when authenticating a user. Once the token is generated, copy its value and save it in a secure place, since you will not be able to retrieve it again.&#x20;

To generate an access token, you must send a POST request using the [token URL](https://api.metahumansdk.io/auth).&#x20;

{% tabs %}
{% tab title="curl" %}

```bash
name="ENTER_YOUR_NAME"
email="ENTER_YOUR_EMAIL"
comment="ENTER_YOUR_COMMENT"

curl -X 'POST' \
  'https://api.metahumansdk.io/auth/token' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'name=${name}&mail=${email}&comment=${comment}'
```

{% endtab %}

{% tab title="python" %}

<pre class="language-python"><code class="lang-python">import requests

name = "ENTER_YOUR_NAME"
email = "ENTER_YOUR_EMAIL"
comment = "ENTER_YOUR_COMMENT"

def print_token():
<strong>    service_url = "http://api.metahumansdk.io/auth"
</strong>    service_headers = {"accept": "application/json"}
    data = {
        "name": name,
        "mail": email,
        "comment": comment
    }
    response = requests.post(service_url + "/token", headers=service_headers, data=data)
    assert (response.status_code == 200)
    
    print(response.json())

if __name__ == "__main__":
    print_token()

</code></pre>

{% endtab %}
{% endtabs %}

Expected output:

```json
{'result': {'token': '5775d7ad-d1d3-4aea-83cf-1c14512f70cc'}}
```

{% hint style="warning" %}
Note: Do not forget to replace the details in the request with your own.
{% endhint %}

{% hint style="info" %}
We promise not to spam you and keep your email private, you will only receive important updates from us.
{% endhint %}
