Creators

End a campaign

Sets a campaign end date aligned to a billing cycle. Assignments reaching past the end fail the request unless the consent flags resolve them: endAssignments reschedules them to their last full period before the end, revokeAssignments deletes rows that cannot keep a single period. Settled payout windows past a row's target keep blocking regardless. Read GET /campaigns/{id}/end-context first for the aligned dates and the assignments the end would cut off. The response's warnings name Highest Tier bonus tiers the new end keeps from paying (bonus_tiers_unpaid_after_end); they never block the end.

post/campaigns/{id}/end

Request

  • Base URL: https://viral.app/api/v1
  • URL: https://viral.app/api/v1/campaigns/{id}/end
  • Auth: API key in header x-api-key

Path parameters

idstring required

Campaign ID with orgcamp_ prefix

Example:orgcamp_RwmraAffhMt9

Request body

endBasis'prev' | 'current' | 'next' | 'custom' required
endDatestring date

Campaign valid until date in ISO format (YYYY-MM-DD)

endAssignmentsboolean
revokeAssignmentsboolean

Example request

{
  "endBasis": "current"
}

Response

OK

idstring required

Campaign ID with orgcamp_ prefix

validUntilstring required

ISO date (YYYY-MM-DD) when the campaign ends.

endedAssignmentsinteger required
revokedAssignmentsinteger required

Example response

{
  "id": "campaign_RwmraAffhMt9",
  "validUntil": "2025-06-30",
  "endedAssignments": 2,
  "revokedAssignments": 0,
  "warnings": []
}

Changes

No recorded changes to this operation across all 1 revision of this API.