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

# List Campaigns

> Lists the active granted campaigns at your sandbox merchant. Use a campaign's id as the campaign_id for Grant Reward.

> [!NOTE]
>
> Please review proper request headers [here](https://docs.thanx.com/consumer/usage/headers.md).

<Snippet file="sandbox/auth.mdx" />

The list contains exactly the campaigns [`POST /rewards/grant`](https://docs.thanx.com/consumer/rewards/grant-reward) accepts. Sandbox provisioning seeds one granted campaign per reward template, so a newly provisioned sandbox merchant already has campaigns to grant.

### Parameters

**merchant\_id** `string`

Only return campaigns for this merchant. Only needed if your `X-ClientId` has access to more than one merchant.

### Response

The list is not paginated. Campaigns are returned in creation order.

**campaigns** `array`

**campaign**

**id** `string`

The campaign ID. Pass it as `campaign_id` to [Grant Reward](https://docs.thanx.com/consumer/rewards/grant-reward.md).

**merchant\_id** `string`

The merchant ID

**name** `string`

The campaign name: the reward template's name, or the campaign's own name when it has no template

**redeem** `hash`

The reward the campaign issues, in the same format as a reward's `redeem` object, plus:
`uses_coupon_codes` (always present), and `discount`, `minimum_spend`, `maximum_spend`, `percent`, `discounted_product_ids` and `required_product_ids`. Fields that aren't set for the campaign are left out of the response.

### Errors

| Status | Code | When |
| - | - | - |
| `400` | `CLIENT_ID_HEADER_INVALID` | The `X-ClientId` header is missing or doesn't match an app |
| `401` | `AUTHENTICATION_GENERIC` | An `Authorization` header was sent with an invalid token |
| `403` | `FORBIDDEN` | Called in production, or `merchant_id` is a merchant your `X-ClientId` can't access |

```bash List Campaigns theme={null}
curl https://api.thanxsandbox.com/campaigns \
  -X GET \
  -H "Accept-Version: v4.0" \
  -H "Accept: application/json" \
  -H "X-ClientId: ${client_id}"
```

```json theme={null}
{
  "campaigns": [
    {
      "id": "85133c3c1258",
      "merchant_id": "ghwou3457f",
      "name": "$5 off your next purchase",
      "redeem": {
        "type": "manual",
        "text": "$5 off",
        "detail": "Get $5 off your next purchase",
        "venue": "all",
        "window": 60,
        "uses_coupon_codes": false,
        "discount": 5.0
      }
    }
  ]
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.