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

# Campaigns

> Retrieve active offers and trigger campaign push notifications.

[← Back to API Integration](/integration/api-integration)

Requires authentication — see [Authentication](/integration/api-integration/authentication).

## Get offers

<span className="text-xs font-mono font-semibold bg-[#07C983]/15 text-[#15803D] dark:bg-[#07C983]/20 dark:text-[#07C983] px-2 py-1 rounded">GET</span> `/api/v1/campaigns/offers`

Returns every offer currently live for your partner ID. Each item is an [Offer object](/integration/api-integration/core-objects) — use it to build your own reward listing, or to find an offer ID to push as a campaign.

No query parameters.

<RequestExample>
  ```bash cURL theme={null}
  curl --get "$BASE/api/v1/campaigns/offers" \
    --header "X-API-Key: $KEY" \
    --header "Accept: application/json"
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch(
    `${BASE}/api/v1/campaigns/offers`,
    { headers: { "X-API-Key": KEY } }
  );
  const { data } = await res.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "data": [
      {
        "id": "67dd795d86f2741c8842cbf1",
        "partner": "Advertiser",
        "partnerLogo": "https://…/logo.png",
        "ageRestricted": false,
        "terms": "Offer valid until stocks last.",
        "title": "50% Discount",
        "description": "Get 50% off selected products.",
        "image": "https://…/image.png",
        "squareImage": "https://…/square.png",
        "offerInfoButtonDiscount": "50%",
        "offerDiscountCode": "SUMMER50",
        "offerDiscountCodeType": "availableAtCheckout",
        "hasMultipleCodes": false
      }
    ]
  }
  ```
</ResponseExample>

See [Errors](/integration/api-integration/errors) for the 401 shape.

## Create a campaign

<span className="text-xs font-mono font-semibold bg-[#0B1B2B]/10 text-[#0B1B2B] dark:bg-[#0B1B2B]/40 dark:text-white px-2 py-1 rounded">POST</span> `/api/v1/campaigns/send`

Triggers a push notification for one of your offers. Give us the offer ID; add a `topic` to reach a group of users at once.

**Body parameters**

<ParamField body="offerId" type="string" required>
  The offer to notify on. e.g. `"67dd795d86f2741c8842cbf1"`
</ParamField>

<ParamField body="topic" type="string">
  FCM topic name, to send to multiple users. e.g. `"rewards-updates"`
</ParamField>

<ParamField body="note" type="string">
  Internal note describing the campaign.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "$BASE/api/v1/campaigns/send" \
    --header "X-API-Key: $KEY" \
    --header "Content-Type: application/json" \
    --data '{
      "offerId": "67dd795d86f2741c8842cbf1",
      "note": "Notify users about new rewards",
      "topic": "rewards-updates"
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`${BASE}/api/v1/campaigns/send`, {
    method: "POST",
    headers: {
      "X-API-Key": KEY,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      offerId: "67dd795d86f2741c8842cbf1",
      note: "Notify users about new rewards",
      topic: "rewards-updates",
    }),
  });
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "data": {
      "id": "67dd795d86f2741c8842cbf1",
      "sentAt": "2025-12-15T12:45:00Z"
    }
  }
  ```
</ResponseExample>

See [Errors](/integration/api-integration/errors) for the 401 and 422 shapes.
