# 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/impact-brand/docs/saasquatch-rest-api-1).

## 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: 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://integrations.impact.com/integration-guides/for-brands/advocate/advocate-api/graphql-api.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.
