# API Authentication

## Administrator Basic Authentication

{% hint style="info" %}
You can use HTTP Basic Authentication if you are an Administrator with a username and password (non-SSO).

To check if you are an Administrator, go to `My profile > Organisation settings > Administrators`.
{% endhint %}

{% openapi src="<https://3471212993-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJpmk4J5g3Kj2RRRpYUrl%2Fuploads%2Fi0BYF0dr31g2XDn1Ehm8%2Fhq-openapi.yml?alt=media&token=ccfc8054-faae-4600-ad93-e2093e443969>" path="/v1/login" method="post" %}
[hq-openapi.yml](https://3471212993-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJpmk4J5g3Kj2RRRpYUrl%2Fuploads%2Fi0BYF0dr31g2XDn1Ehm8%2Fhq-openapi.yml?alt=media\&token=ccfc8054-faae-4600-ad93-e2093e443969)
{% endopenapi %}

```bash
# EXAMPLE
# Get a list of users
curl https://lenses.example.com/api/v1/users/me -u my-admin-user:my-admin-password
```

## Service Accounts

Use a Bearer Token to authenticate service accounts. Set the token in the HTTP header request.

```bash
# EXAMPLE
# Get the list of environments via API
curl https://lenses.example.com/api/v1/environments \
  -H 'Authorization: Bearer MY_SERVICE_ACCOUNT_KEY'
```
