---
title: "Billing period started"
method: POST
path: "assignment.period_started"
tags: ["Webhook Events"]
---

# Billing period started

`POST assignment.period_started` (webhook)

A new billing period of an assignment began. Periods turn at midnight in the campaign's zone (`period.timeZone`; `period.startsAt` is the exact instant); reported shortly after.

## Headers

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

## Payload

- AssignmentPeriodStartedWebhookEvent: A new billing period of an assignment began. Periods turn at midnight in the campaign's zone (`period.timeZone`; `period.startsAt` is the exact instant); reported shortly after.
  - `id` string, required: Event id; the `webhook-id` header. The same on every retry: dedupe on it.
  - `type` 'assignment.period_started', 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
    - `period` WebhookBillingPeriod, required
      - `start` string, date-time, required
      - `end` string, date-time, required
      - `timeZone` string, required: IANA time zone the campaign's periods and dates follow (a period ends at midnight in this zone). Views are still counted per UTC day.
      - `startsAt` string, date-time, required: The instant the period starts: its first day's midnight in `timeZone`, with that zone's offset.
      - `endsAt` string, date-time, required: The instant the period ends: the midnight after its last day in `timeZone` (exclusive).
      - `startedMidPeriod` boolean, required
      - `endedEarly` boolean, 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)
