Rafobase Logo

Update a campaign

Update campaign settings. Reward type cannot be changed after creation.

PATCH
/campaigns/{id}

Update campaign settings. Reward type cannot be changed after creation.

Authorization

bearerAuth
AuthorizationBearer <token>

API key authentication. Use your API key as the bearer token.

In: header

Path Parameters

id*string

Campaign ID

Request Body

application/json

name?string
reward_value?integer
warranty_days?integer
min_redemption?integer
is_active?boolean
auto_register?boolean

Response Body

application/json

application/json

application/json

curl -X PATCH "https://api-base.rafo.work/api/v1/campaigns/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "data": {
    "id": "camp_xxxxx",
    "name": "Default Referral Program",
    "reward_type": "percentage",
    "reward_value": 0,
    "warranty_days": 0,
    "min_redemption": 0,
    "is_active": true,
    "is_default": true,
    "auto_register": true,
    "stats": {
      "total_members": 0,
      "total_referrals": 0,
      "total_rewards_paid": 0
    },
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing API key"
  }
}
{
  "error": {
    "code": "not_found",
    "message": "Resource not found"
  }
}