> ## Documentation Index
> Fetch the complete documentation index at: https://docs.markifact.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Spotify Ads App

> Connect Spotify Ads through your own Spotify app (white-label) by pasting your client ID, client secret, and a refresh token.

Markifact supports two ways to connect Spotify Ads: using the built-in **Markifact app** (Quick Connect) or connecting through your own **Spotify app** (Custom App). With a custom app, every request Markifact makes to the Spotify Ads API runs under your app, so your clients never see Markifact in their connected apps.

<Note>
  Custom app connections are available on the **Team** plan. See [White-label Connections](/core-concepts/white-label-connections) for the overview.
</Note>

***

## Quick Connect vs Custom App

| Feature                 | Quick Connect        | Custom App                                   |
| :---------------------- | :------------------- | :------------------------------------------- |
| **Setup Time**          | 1 minute             | 15-20 minutes, plus Spotify's Ads API access |
| **App the client sees** | Markifact            | Yours                                        |
| **API rate limits**     | Markifact's app      | Your app                                     |
| **White Label**         | No                   | Yes                                          |
| **Plan**                | All plans            | Team                                         |
| **Best For**            | Quick setup, testing | Agencies, strict client requirements         |

***

## What You Need

Three values from your own Spotify app:

| Value             | Where it comes from                                                                    |
| :---------------- | :------------------------------------------------------------------------------------- |
| **Client ID**     | Your app in the [Spotify developer dashboard](https://developer.spotify.com/dashboard) |
| **Client Secret** | The same app                                                                           |
| **Refresh Token** | Minted against that app by the Spotify account that has access to the Ads business     |

Spotify access tokens last one hour; Markifact refreshes them with your client ID and secret on every run. Refresh tokens stay valid until the user removes the app from their account.

<Note>
  **Already have your own authorization flow?** If your systems already hold a refresh token issued by your app, skip to [Connect to Markifact](#connect-to-markifact).
</Note>

***

## Setting Up Your Custom Spotify Ads App

<Steps>
  <Step title="Create the App">
    1. Open the [Spotify developer dashboard](https://developer.spotify.com/dashboard) and click **Create app**
    2. Enter the app name and description. This is the branding users see when they authorize
    3. Under **Redirect URIs**, add a URL you control (for example `https://www.youragency.com/spotify-callback`). Spotify appends the auth code to this URL after authorization; the page does not need to do anything
    4. Save, then open **Settings** and copy the **Client ID** and **Client secret**
  </Step>

  <Step title="Request Spotify Ads API Access">
    The Ads API is not part of the public Spotify Web API. Ask your Spotify Ads representative to enable Ads API access for your app's client ID and wait for confirmation. Agencies that already run their own integrations will have this in place; until it is granted, the businesses endpoint returns authorization errors.
  </Step>

  <Step title="Authorize and Get the Auth Code">
    1. Open the following URL in a browser, replacing the client ID and redirect URI:

    ```bash theme={"dark"}
    https://accounts.spotify.com/authorize?client_id=YOUR_CLIENT_ID&response_type=code&redirect_uri=https%3A%2F%2Fwww.youragency.com%2Fspotify-callback&state=markifact
    ```

    2. Sign in as the Spotify account that has access to the Ads business and click **Agree**
    3. Spotify redirects to your URL with `code=...` in the query string. Copy the value. Auth codes expire quickly and can be exchanged once, so do the next step right away
  </Step>

  <Step title="Exchange the Auth Code for a Refresh Token">
    Run this request, replacing the values (the redirect URI must match the one used above exactly):

    ```bash theme={"dark"}
    curl -X POST "https://accounts.spotify.com/api/token" \
      -u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \
      -H "Content-Type: application/x-www-form-urlencoded" \
      -d "grant_type=authorization_code" \
      -d "code=THE_AUTH_CODE" \
      -d "redirect_uri=https://www.youragency.com/spotify-callback"
    ```

    The response contains `refresh_token`. Copy it.

    > **Important:** Keep this token secure. Anyone holding it, together with your client ID and secret, can act on every ad account the user can reach.
  </Step>

  <Step title="Connect to Markifact">
    1. In Markifact, go to the [Connections](https://app.markifact.com/connections) page
    2. Click **Connect** on **Spotify Ads**
    3. Select the **Custom App (White-label)** tab
    4. Enter a **Connection Name** (for example "Acme Agency Spotify Ads")
    5. Paste your **Client ID**, **Client Secret**, and **Refresh Token**
    6. Click **Verify & Connect**

    Markifact refreshes the token once with your app, then makes one call that lists the ad businesses the account belongs to. Nothing is saved unless both succeed.
  </Step>
</Steps>

***

## Selecting Your Connection

Custom app connections appear under the name you chose, with a **Custom app** badge on the Connections page. Select them in Spotify Ads nodes, agents, and MCP exactly like any other Spotify Ads connection.

***

## Rotating or Replacing the Token

Add the connection again with the **same connection name** and the new values. Markifact replaces the stored credentials in place, so workflows and agents bound to the connection keep working.

***

## Troubleshooting

<Accordion title="Spotify rejected the client ID or client secret (invalid_client)">
  Check both values under **Settings** on your app's page in the developer dashboard. Rotating the secret there invalidates the old one.
</Accordion>

<Accordion title="Spotify rejected the refresh token (invalid_grant)">
  The token was issued by a different app than the one whose client ID you pasted, or the user removed the app under their Spotify account's **Apps** settings. Authorize again and paste the new refresh token.
</Accordion>

<Accordion title="Spotify Ads API refused access (403)">
  Your app has not been granted Ads API access yet, or the account cannot reach the ad accounts. Confirm the access with your Spotify Ads representative, then try again.
</Accordion>

<Accordion title="This Spotify account belongs to no ad business">
  The account that authorized has no access to a Spotify Ads business. Add it as a user on the business, then authorize again.
</Accordion>

***

## Summary

| Item              | Where to Find                                     | What It Looks Like |
| ----------------- | ------------------------------------------------- | ------------------ |
| **Client ID**     | Spotify developer dashboard > your app > Settings | `a1b2c3d4e5f6...`  |
| **Client Secret** | Same page                                         | `f6e5d4c3b2a1...`  |
| **Refresh Token** | Response of the auth code exchange                | `AQD...`           |

***

## Related

<CardGroup cols={2}>
  <Card title="White-label Connections" icon="tag" href="/core-concepts/white-label-connections">
    Overview of custom app connections across channels
  </Card>

  <Card title="Get Report" icon="chart-line" href="/nodes/spotify_ads/spotify_ads_get_report">
    Pull Spotify Ads performance data
  </Card>
</CardGroup>
