> For the complete documentation index, see [llms.txt](https://integrations.impact.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://integrations.impact.com/integration-guides/for-brands/advocate/advocate-api/graphql-api.md).

# GraphQL API

The Advocate GraphQL API provides an API for building custom Advocate participant experiences, integrations, and admin interfaces based on GraphQL. Authentication for the GraphQL API is the same as the [Advocate REST API](https://integrations.impact.com/integration-guides/for-brands/advocate/advocate-api/advocate-rest-api).

## Endpoint

There is one endpoint for working with GraphQL. If you are integrating a referral program into your site, use the tenant endpoint so that you don't need to specify your `tenant_alias` throughout your GraphQL queries.

{% tabs %}
{% tab title="Tenant endpoint" %}

```html
https://app.referralsaasquatch.com/api/v1/`{tenant_alias}`/graphql
```

{% endtab %}
{% endtabs %}

To retrieve your tenant alias:

* In your impact.com account, from the top navigation bar, select **\[User Profile] →** [**Settings**](https://app.impact.com/secure/advertiser/account-settings-flow.ihtml?execution=e9s1).
* From the *Advocate Settings* section, select **General**.
* Retrieve your tenant alias from the *Tenant Details* section.

## Access GraphQL

1. In your impact.com account, select **\[User Profile] →** [**Settings**](https://app.impact.com/secure/advertiser/account-settings-flow.ihtml?execution=e9s1) from the top navigation bar.
2. From the *Advocate Settings* section, select **GraphQL**.

From this interface, you can run queries and see results.

## Run GraphQL queries

1. Enter your query in the leftmost panel (see image above as an example).
2. Select <i class="fa-play-circle">:play-circle:</i> **\[Run]**.
   * See the **Documentation Explorer** on the right of the screen for the complete GraphQL schema available to build queries with.
3. See the results in the middle pane.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://integrations.impact.com/integration-guides/for-brands/advocate/advocate-api/graphql-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
