---
title: "Assignment ended"
method: POST
path: "assignment.ended"
tags: ["Webhook Events"]
---

# Assignment ended

`POST assignment.ended` (webhook)

An assignment's last day passed. Reported right away for an end today or in the past (an unassign, a settlement that ends it today), otherwise shortly after midnight in the campaign's zone the day after (`scheduled`).

## Headers

- `webhook-id` string, required
- `webhook-timestamp` string, required
- `webhook-signature` string, required

## Payload

- AssignmentEndedWebhookEvent: An assignment's last day passed. Reported right away for an end today or in the past (an unassign, a settlement that ends it today), otherwise shortly after midnight in the campaign's zone the day after (`scheduled`).
  - `id` string, required: Event id; the `webhook-id` header. The same on every retry: dedupe on it.
  - `type` 'assignment.ended', required
  - `timestamp` string, date-time, required: When the change happened
  - `organizationId` string, required
  - `actor` WebhookActor, required: Who caused the event: a member (`user`), an API key (`apiKeyId`), a creator, or viral.app itself (`system`); `surface` says where the change entered. Skip events your own API key caused to avoid loops.
    - `type` 'user' | 'api_key' | 'creator' | 'system', required
    - `surface` 'ui' | 'api' | 'copilot' | 'system', required
    - `userId` string, nullable, required
    - `apiKeyId` string, nullable, required
    - `impersonated` boolean, required
  - `data` object, required
    - `assignment` WebhookAssignment, required
      - `id` string, required
      - `orgCreatorId` string, required
      - `creatorUserId` string, required
      - `campaignId` string, required
      - `campaignName` string, required
      - `validFrom` string, date, required
      - `validUntil` string, date, nullable, required
      - `status` 'previous' | 'active' | 'upcoming', required
    - `reason` 'unassigned' | 'campaign_ended' | 'creator_archived' | 'subscription_lapsed' | 'settled' | 'scheduled', required

## Acknowledgement `200`

Any 2xx within 15 seconds acknowledges the event. Anything else, a timeout or a redirect is retried (10 attempts over about 3 days); 410 disables the endpoint.

---

[API](https://skmtc.dev/viral/apis/viral-app-api.md) · [All operations](https://skmtc.dev/viral/apis/viral-app-api/llms.txt) · [OpenAPI document](https://skmtc.dev/viral/apis/viral-app-api/revisions/31e97fa79ef1?raw)
