> For the complete documentation index, see [llms.txt](https://docs.sparkloop.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sparkloop.app/api-v2-deprecated/endpoints/subscribers-2.md).

# Partner Programs

## Get partner programs

<mark style="color:blue;">`GET`</mark> `https://api.sparkloop.app/v2/partner_programs`

Partner programs are ordered descendingly by *created\_at*, meaning the first page shows the latest publications.

{% tabs %}
{% tab title="200 Used query params ?page=1\&per\_page=2" %}

```json
{
  "partner_programs": [
    <Partner Program Object>,
    <Partner Program Object>
  ],
  "meta": {
    "per_page": 2,
    "page": 1,
    "total_pages": 12,
    "total_partner_programs": 24
  }
}
```

{% endtab %}
{% endtabs %}

## Get a partner program

<mark style="color:blue;">`GET`</mark> `https://api.sparkloop.app/v2/partner_programs/:identifier`

Returns a single partner program by UUID

#### Path Parameters

| Name                                         | Type   | Description            |
| -------------------------------------------- | ------ | ---------------------- |
| identifier<mark style="color:red;">\*</mark> | string | Partner program's UUID |

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

```json
{
  "partner_program":
    <Partner Program Object>
}
```

{% endtab %}

{% tab title="404 " %}
{% tabs %}
{% tab title="Partner program not found" %}

```
{
    "error": "Partner program partner_program_4bc10562d97 not found!"
}
```

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

## Update partner program

<mark style="color:orange;">`PUT`</mark> `https://api.sparkloop.app/v2/partner_programs/:identifier`

#### Path Parameters

| Name                                         | Type   | Description            |
| -------------------------------------------- | ------ | ---------------------- |
| identifier<mark style="color:red;">\*</mark> | string | Partner program's UUID |

#### Request Body

| Name                                  | Type    | Description                                                                                                                                      |
| ------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| slug                                  | String  | Unique custom signup page URL. If you set `slug` to *morning-stew*, the signup page URL is *<https://partnerprogram.page/morning-stew>*          |
| terms                                 | String  | Custom partner program conditions.                                                                                                               |
| referral\_pending\_duration\_enabled  | boolean | Set to `true` to exclude referrals that unsubscribe shortly after signup.                                                                        |
| referral\_pending\_duration           | number  | Days a subscriber must stay subscribed before the referral is confirmed. At most 30.                                                             |
| accept\_referrals\_from               | string  | Who partners can refer: `worldwide`, `us_only`, or `custom`.                                                                                     |
| blocked\_countries                    | array   | Alpha-2 country codes to block (e.g. `["GB", "CA"]`). Use with `accept_referrals_from=custom`. Cannot be sent together with `allowed_countries`. |
| allowed\_countries                    | array   | Alpha-2 country codes to allow (e.g. `["US", "CA"]`). Use with `accept_referrals_from=custom`. Cannot be sent together with `blocked_countries`. |
| restrict\_impressions\_to\_us\_states | boolean | When `accept_referrals_from` is `us_only`, limit impressions to selected US states.                                                              |
| allowed\_regions                      | array   | US state Alpha-2 codes (e.g. `["NY", "CA"]`). Used when `restrict_impressions_to_us_states` is `true`.                                           |

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

```json
{
  "partner_program":
    <Partner Program Object>
}
```

{% endtab %}

{% tab title="400 " %}
{% tabs %}
{% tab title="Blocked and allowed countries together" %}

```json
{
    "error": "You can either block or allow certain countries."
}
```

{% endtab %}

{% tab title="Empty body" %}

```json
{
    "error": "You have to update at least 1 field."
}
```

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

{% tab title="404 " %}
{% tabs %}
{% tab title="Partner program not found" %}

```json
{
    "error": "Partner program partner_program_34c8e39ca4 not found."
}
```

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