# API Quick Start

Use this tutorial when you authenticate as a Brand, Partner, or Agency with *HTTP Basic* using an impact.com–issued token pair (*Account SID* and *Auth Token*).

To get started with the impact.com REST API, you'll need to mint credentials in [**impact.com**](https://app.impact.com/) and then call the REST API (**`https://api.impact.com/...)`** from software tools that your organization operates like a terminal + curl, Postman, or Python code.

{% stepper %}
{% step %}

### Create an API access token

impact.com APIs expect HTTP Basic credentials (*Account* *SID* as username, *Auth Token* as password).

Follow [**Create an API Key**](/rest-apis/api-quick-start/create-an-api-key.md) to mint your token.
{% endstep %}

{% step %}

### Store credentials securely

Never hardcode secrets in repositories. Only store secrets in a vault or in encrypted environment variables, never in source control or shared chats.

```bash
export IMPACT_SID="YOUR_ACCOUNT_SID"
export IMPACT_TOKEN="YOUR_AUTH_TOKEN"
```

{% endstep %}

{% step %}

### Make your first API call (smoke test)

These examples call the **campaigns** endpoint with a **GET** query. You can make more detailed queries later via your persona REST reference pages.

{% tabs %}
{% tab title="Brand" %}

<pre class="language-bash"><code class="lang-bash"><strong>curl --get \
</strong>  "https://api.impact.com/Advertisers/{AccountSID}/Campaigns" \
  -u "{AccountSID}:{AuthToken}" \
  -H "Accept: application/json"
</code></pre>

```python
import os
import requests
from requests.auth import HTTPBasicAuth

sid = os.environ["AccountSID"]
tok = os.environ["AuthToken"]
url = f"https://api.impact.com/Advertisers/{sid}/Campaigns"
r = requests.get(url, auth=HTTPBasicAuth(sid, tok), headers={"Accept": "application/json"})
print(r.status_code)
```

{% endtab %}

{% tab title="Partner" %}

```bash
curl --get \
  "https://api.impact.com/MediaPartners/{AccountSID}/Campaigns" \
  -u "{AccountSID}:{AuthToken}" \
  -H "Accept: application/json"
```

```python
import os
import requests
from requests.auth import HTTPBasicAuth

sid = os.environ["AccountSID"]
tok = os.environ["AuthToken"]
url = f"https://api.impact.com/MediaPartners/{sid}/Campaigns"
r = requests.get(url, auth=HTTPBasicAuth(sid, tok), headers={"Accept": "application/json"})
print(r.status_code)
```

{% endtab %}

{% tab title="Agency" %}

```bash
curl --get \
  "https://api.impact.com/Agencies/{AccountSID}/Campaigns" \
  -u "{AccountSID}:{AuthToken}" \
  -H "Accept: application/json"
```

```python
import os
import requests
from requests.auth import HTTPBasicAuth

sid = os.environ["AccountSID"]
tok = os.environ["AuthToken"]
url = f"https://api.impact.com/Agencies/{sid}/Campaigns"
r = requests.get(url, auth=HTTPBasicAuth(sid, tok), headers={"Accept": "application/json"})
print(r.status_code)
```

{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}

### Verify you're authenticated

* **HTTP 200** (2xx) → success.
* **401** → bad or missing SID/token pair.
* **403** → good auth mechanics but persona path or scopes block the resource. Double-check **`Advertisers`**, **`MediaPartners`**, **`Agencies`**, plus token toggles.
* **429** → slow down your requests. Add exponential backoff plus jitter inside scripts or agents.

For more detail, browse your persona docs linked from `https://integrations.impact.com/llms.txt`.
{% endstep %}
{% endstepper %}

### What to read next

After you smoke-test, check [**Create an API Key**](/rest-apis/api-quick-start/create-an-api-key.md) for a detailed UI checklist, including scope toggles, API version pinning, rotations, duplication, disables, deletes, and legacy migration patterns.

### Coming soon

OAuth 2.0 Authorization Code and PKCE flows for apps operating on behalf of many customers. Documentation will publish here alongside developer onboarding once available.

{% hint style="success" %}
**Using an AI assistant?**

*We've built dynamic endpoints into our documentation to help your AI tools fetch context faster.*

System instructions for AI Agents:

* **Index**: `GET` [`https://integrations.impact.com/llms.txt`](https://integrations.impact.com/llms.txt) for `.md` sources.
* **Token Limit**: Fetch only necessary `.md` and OpenAPI routes to conserve context.
* **Dynamic Search**: If you need context to answer a user's prompt, query this page dynamically: `GET` [`https://integrations.impact.com/{insert_current_page_path}.md?ask=`](https://integrations.impact.com/{insert_current_page_path}.md?ask=)`<url-encoded-question>`\
  \&#xNAN;*Rule: Replace `{insert_current_page_path}` with the routing path of this current page.*
  {% endhint %}


---

# 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/rest-apis/api-quick-start.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.
