# Rewards Orchestrator

Communiqr's Rewards Orchestrator, embodied in the Campaign API, takes center stage in redefining the landscape of user engagement and loyalty programs. This in-depth exploration delves into the architecture of Communiqr's Campaign API, spotlighting its distinctive campaign structure, diverse conditions, actions, and a streamlined workflow for seamless campaign creation and management.

1. **Deciphering the Campaign Structure: Conditions & Actions:**
   * *Campaign Foundation:* Users initiate campaigns, but rewards are claimed by eligible users.
   * *Fundamental Objects:* Conditions (eligibility rules) and Actions (tasks triggered upon claim) govern campaign dynamics.
2. **Exploring Communiqr's Unique Campaign Conditions:**
   * *Transformative Naming:* Familiar conditions reborn with fresh identities.
   * *Illustrative Examples:* Twitter Social Bond, Unverified Social Link, Manual Content Creation, and more.
   * *Dynamic General Campaigns:* Prioritizing claim frequency over specific user actions.
3. **Revitalizing Campaign Actions with Communiqr's Ingenuity:**
   * *Innovative Actions:* Two pivotal actions - mint and dual-mint - revolutionize token distribution.
   * *Mint Action:* Issuing Co:Create-issued tokens to a specified user's wallet.
   * *Dual-Mint Action:* Simultaneously minting tokens to two users, supporting unique referral scenarios.
4. **Navigating the Campaign Workflow: A Symphony of Steps:**
   * *Create a Campaign:* Crafting campaigns by defining conditions and actions through available parameters.
   * *Verify User Eligibility:* Utilizing the Campaign ID and claimant's email to ensure conditions are met for claiming rewards.
   * *Claim a Campaign Reward:* Triggering campaign actions by providing the Campaign ID and claimant's email.
5. **Embarking on the Journey Through API Endpoints:**
   * *Base URL:* The Campaign API's foundation at /alpha/campaign.
   * *Endpoint Highlights:* A comprehensive guide to key endpoints facilitating campaign creation, management, and user interactions.
6. **A Glimpse into the Campaign Creation Process with Communiqr:**
   * *Request Body Parameters:* Crafting campaigns with parameters like title, subtitle, description, and media URL.
   * *Condition & Action Definitions:* Redefined conditions and actions with unique identifiers for Communiqr's ecosystem.

| **Endpoint**                  | **Method** | **Description**                            |
| ----------------------------- | ---------- | ------------------------------------------ |
| `/alpha/campaign`             | POST       | Create a new campaign                      |
| `/alpha/campaign/{id}`        | GET        | Retrieve details of a specific campaign    |
| `/alpha/campaign/{id}`        | PATCH      | Update an existing campaign                |
| `/alpha/campaign/{id}`        | DELETE     | Remove a campaign                          |
| `/alpha/campaign/{id}/cancel` | POST       | Permanently terminate a campaign           |
| `/alpha/campaign/{id}/resume` | POST       | Resume a paused or draft campaign          |
| `/alpha/campaign/{id}/pause`  | POST       | Temporarily suspend a campaign             |
| `/alpha/campaign/{id}/verify` | GET        | Check user eligibility and claim history   |
| `/alpha/campaign/{id}/claim`  | POST       | Claim a campaign reward for eligible users |

| **Request Body Parameters** | **Type** | **Description**                                     |
| --------------------------- | -------- | --------------------------------------------------- |
| `title`                     | string   | Name or label for the campaign                      |
| `subtitle`                  | string   | Additional label or explanatory text                |
| `description`               | string   | Summary of the campaign's goal and purpose          |
| `media_url`                 | string   | Optional URL of a media file                        |
| `condition`                 | object   | Condition object representing eligibility rules     |
| `action`                    | object   | Action object representing tasks triggered on claim |

| **Condition Parameters** | **Type** | **Description**                                     |
| ------------------------ | -------- | --------------------------------------------------- |
| `type`                   | enum     | Type of condition (sign\_up, profile\_update, etc.) |
| `name`                   | string   | Optional name for the condition                     |
| `description`            | string   | Optional description of the condition               |

| **Action Parameters** | **Type**      | **Description**                           |
| --------------------- | ------------- | ----------------------------------------- |
| `type`                | enum          | Type of campaign action (mint, dual-mint) |
| `token_type`          | enum          | Type of token to mint (SPL)               |
| `id`                  | string (UUID) | UUID of the token to mint                 |
| `payout_amount`       | number        | Amount of tokens to mint to the user      |
