> 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 dynamically by asking a question.

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

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
