# Getting Started Using the Client-Server API

<!---
Actions needed:
- [ ] 

# Getting Started Using the Admin API
--->

<!---<p class="callout info">Remember to check our <a href="https://ems-docs.element.io/books/kieranml-test-book/page/have-you-tried-httpselementiohelp">Looking for help?</a> page for answers to Frequently Asked Questions and our User Guide!</p>--->

The <a href="https://spec.matrix.org/latest/client-server-api/" target="_blank" rel="noopener noreferrer">Client-Server API</a> allows a user to perform any action they could via a Matrix client programatically. In order to make use of the API you will need to retrieve an access token for your account.

### Getting your `access_token`

In order to use the <a href="https://spec.matrix.org/latest/client-server-api/" target="_blank" rel="noopener noreferrer">Client-Server API</a> you will need to authenticate your calls to the API using an `access_token` from your user account. You can find your `access_token` from the `Help & About` section of your settings. Check out the [Help & About](https://ems-docs.element.io/books/element-support/page/help-about) page from the [Element Web/Desktop Client Settings](https://ems-docs.element.io/books/element-support/chapter/element-webdesktop-client-settings) chapter for more guidance.

### Making a Client-Server API request

Using your preferred method, you will need to authenticate each request to a Client-Server API endpoint by providing the token as either a query parameter or a request header. To add it as a request header in cURL, you can use the following, replacing `syt_AjfVef2_L33JNpafeif_0feKJfeaf0CQpoZk` with your own `access_token`:

```bash
curl --header "Authorization: Bearer syt_AjfVef2_L33JNpafeif_0feKJfeaf0CQpoZk" -X GET https://HOMESERVER_URL/_matrix/client/v0/profile/@user:example.com
```

Here is the equivalent action using Python and the `requests` library:

```python
import requests

headers = {
    'Authorization': 'Bearer syt_AjfVef2_L33JNpafeif_0feKJfeaf0CQpoZk',
}

response = requests.get('https://HOMESERVER_URL/_matrix/client/v0/profile/@user:example.com', headers=headers)
```

Further details on the using the API are out-of-scope for this documentation, please consult the <a href="https://spec.matrix.org/latest/client-server-api/" target="_blank" rel="noopener noreferrer">Client-Server API</a> documentation.