# Making Requests

{% hint style="info" %}
Update from 29th November 2024 - Plannr now offers a new field "preferred\_account\_uuid" which can be used, however if you have built your integration before this date, you will not be enrolled in the new authentication. Please get in touch with <integrations@plannrcrm.com> if you would like your integration to use this new "Preferred Account" specified by users.
{% endhint %}

## Getting the X-PLANNR-ACCOUNT-UUID header

Most of Plannr's API endpoints support multi-tenancy. This means a UUID must be specified for the account that you want to access data for.  This UUID must be passed into a header called `X-PLANNR-ACCOUNT-UUID`, and API requests that require it will throw an error if you do not provide it.

You can get the `X-PLANNR-ACCOUNT-UUID` header value by making a GET request to [`https://api.plannrcrm.com/api/v1/logins`](https://apidocs.plannrcrm.com/operation/operation-get-api-v1-account-parameter-login) with your access token retrieved in the step before. This endpoint will return a list of **logins** that the user you have connected with has, and you can iterate through these logins, and access the **account->uuid** to get the `X-PLANNR-ACCOUNT-UUID`

If you have built your integration after 29th November 2024, there is an additional field in this API response called `preferred_account_uuid`, which we recommend using, as this is the account they have requested you to use. Otherwise, you should iterate through each of the accounts and use the one that is most suitable. Please note that some users may have an admin account and a client account on one user, so be cautious which one you select.

{% hint style="warning" %}
Please note the **api/v1/logins** route will return logins, with accounts within each login object, you must use the **uuid** field within the **account** object of each login for this. to work.
{% endhint %}

## Required Request Headers

Whenever you make a request to the Plannr API, there are a number of required headers you **MUST** send with the request:

1. `Accept: application/json`
2. `Content-Type: application/json`
3. `Authorization: Bearer YOUR-ACCESS-TOKEN`
4. `X-PLANNR-ACCOUNT-UUID: ACCOUNT-UUID` (On most API calls, not all)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-how-to.plannrcrm.com/getting-started/making-requests.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
