# Recommendations

## Get recommendation

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

#### Path Parameters

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

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

```javascript
{
  "partner_campaign": {
    "uuid": "partner_campaign_a6224cd65cf3",
    "publication_uuid": "pub_5fc782e24409",
    "partner_profile_uuid": "partner_df80bd29bf34",
    "status": "draft",
    "referral_link": "http://link.sparkloop.eu.ngrok.io/p/c3088257c7",
    "cpa": 2.0,
    "max_payout": 500.0,
    "partner_program_uuid": "partner_program_abcdef123",
    "campaign_type": null,
    "thankyou_page_url": null,
    "accepted_terms_at": null,
    "name": "My partner campaign",
    "referral_pending_period": null
  }
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## Get recommendations

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

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

```json
{
  "partner_campaigns": [
    {
      "uuid": "partner_campaign_a6224cd65cf3",
      "publication_uuid": "pub_5fc782e24409",
      "partner_profile_uuid": "partner_df80bd29bf34",
      "status": "draft",
      "referral_link": "http://sparkloop.app/p/c3088257c7",
      "cpa": 2.0,
      "max_payout": 500.0,
      "partner_program_uuid": "partner_program_abcdef123",
      "campaign_type": null,
      "thankyou_page_url": null,
      "accepted_terms_at": null,
      "name": "My partner campaign",
      "referral_pending_period": null
    },
    {
      "uuid": "partner_campaign_1232424",
      "publication_uuid": "pub_5fc782e24409",
      "partner_profile_uuid": "partner_df80bd29bf34",
      "status": "draft",
      "referral_link": "http://sparkloop.app/p/abcde8257c7",
      "cpa": 2.0,
      "max_payout": 500.0,
      "partner_program_uuid": "partner_program_abcdef123",
      "campaign_type": null,
      "thankyou_page_url": null,
      "accepted_terms_at": null,
      "name": "My partner campaign",
      "referral_pending_period": null
    }
  ],
  "meta": {
    "per_page": 3,
    "page": 2,
    "total_pages": 12,
    "total_partner_campaigns": 36
  }    
}
```

{% endtab %}
{% endtabs %}

### Archive recommendation

Use this endpoint to archive a recommendation.

<mark style="color:red;">`DELETE`</mark> `https://api.sparkloop.app/v2/partner_profile/partner_campaigns/:identifier`

#### Path Parameters

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

**Response**

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

```javascript
{
  "recommendation": <Recommendation Object>
}
```

{% endtab %}
{% endtabs %}

### Reactivate recommendation

Use this endpoint to restore an archived recommendation, unless it was archived by a sponsor, in which case reactivation is not possible.

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

#### Path Parameters

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

**Response**

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

```javascript
{
  "recommendation": <Recommendation Object>
}
```

{% endtab %}

{% tab title="422" %}

```json
{
  "error": "This recommendation was archived by the sponsor and can't be re-activated."
}
```

{% endtab %}
{% endtabs %}


---

# 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://docs.sparkloop.app/api-v2/endpoints/partner-profile/recommendations.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.
