access_code.generated
Bulk-generate job completes.
Batch-level only — fires once per generation job, not per code. A 10,000-code batch produces one event.
When this fires
A bulk-generation run for access codes completes. The batch is materialized in the database and is now redeemable.
Required ability
project-access-code:view-any — token must carry this at mint time to subscribe an endpoint to this event.
Payload
{
"id": "evt_01HX...",
"type": "access_code.generated",
"created_at": "2026-05-18T10:05:00Z",
"api_version": "2026-05-01",
"project_id": "prj_01HX...",
"data": {
"batch_id": "btc_01HX...",
"plan_id": "pln_01HX...",
"count": 250,
"expires_at": "2026-08-18T00:00:00Z"
}
}Field reference
| Field | Type | Notes |
|---|---|---|
id | string ULID | Unique event id, prefixed evt_. Use for idempotent processing. |
type | string | Always access_code.generated for this event. |
created_at | ISO 8601 timestamp | Server-side emission time. |
api_version | string | Webhook API contract version. |
project_id | string ULID | Project this event belongs to. |
data.batch_id | string ULID | Batch identifier the generated codes belong to. |
data.plan_id | string ULID | Plan the codes are scoped to. |
data.count | integer | Number of codes in the batch. |
data.expires_at | ISO 8601 timestamp | Common expiry timestamp for all codes in the batch. |
Caveats
- Codes themselves are never delivered through this event — fetch them from the dashboard CSV export.
- Per-code redemption fires
access_code.redeemed; per-code expiry firesaccess_code.expired.
Related events
access_code.redeemed— fires per code on redemption.access_code.expired— fires per code on expiry.- Access code events overview — back to family overview.
How is this guide?