Campaign Management

Update Campaign

Update campaign details such as title, description, content URL, category, tagline, and reward amount. Only the fields you include in the request body will be updated. When reward_amount is changed, the cohort reward distribution is automatically recalculated using the default percentages (100% / 80% / 60% / 40% / ₹3).

PATCH/nfthing/campaign/update

Headers

FieldTypeRequiredDescription
X-API-KeystringYesYour Membrane API key.
Content-TypestringYesMust be application/json.

Request body

FieldTypeRequiredDescription
post_idstringYesThe post_id of the campaign.
titlestringNoNew campaign title.
descriptionstringNoNew campaign description.
content_urlstringNoNew content URL.
categorystringNoNew campaign category.
taglinestringNoNew campaign tagline.
reward_amountnumberNoNew reward amount. Must be positive. Triggers automatic cohort reward recalculation.

Example request

PATCH /nfthing/campaign/update
{
  "post_id": "bbfea083-da7f-492f-a29d-9f66848de9e4",
  "title": "Updated Tech Survey",
  "reward_amount": 20
}

Example response

200 OK
{
  "success": true,
  "message": "Campaign updated successfully",
  "data": {
    "post_id": "bbfea083-da7f-492f-a29d-9f66848de9e4",
    "type": "survey",
    "title": "Updated Tech Survey",
    "description": "Share your thoughts on the latest tech trends",
    "content_url": "https://example.com/tech-survey",
    "category": "technology",
    "tagline": "Your opinion matters",
    "reward_amount": 20,
    "is_live": false,
    "cohort_rewards": {
      "cohort_1_reward": 3,
      "cohort_2_reward": 8,
      "cohort_3_reward": 12,
      "cohort_4_reward": 16,
      "cohort_5_reward": 20
    }
  }
}

Notes

  • At least one field (besides post_id) must be provided.
  • The cohort_rewards field is only included in the response when reward_amount changes.