Early bird discounts live! Claim your offer

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 — 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": "7f3d1c92-8b45-4e6a-9d21-5c8e0a4b6f13",
  "data": {
    "plan_id": "c4e82f16-93a7-4d5b-b81c-6e0f27a94d3b",
    "plan_name": "Premium Monthly",
    "count": 250,
    "expires_at": "2026-08-18T00:00:00Z"
  }
}

Field reference

FieldTypeNotes
idstring ULIDUnique event id, prefixed evt_. Use for idempotent processing.
typestringAlways access_code.generated for this event.
created_atISO 8601 timestampServer-side emission time.
api_versionstringWebhook API contract version.
project_idstring UUIDProject this event belongs to.
data.plan_idstring UUIDPlan the codes are scoped to.
data.plan_namestringPlan display name at generation time.
data.countintegerNumber of codes in the batch.
data.expires_atISO 8601 timestamp, nullableCommon expiry timestamp for all codes in the batch. null when the batch was generated with no expiry.

Caveats

  • Codes themselves are never delivered through this event. The batch is delivered to the creator's Telegram chat as a CSV document or as one message per code, depending on the export type chosen at generation; to fetch them programmatically use GET /v1/projects/{project}/plans/{plan}/access-codes.
  • There is no batch identifier in the payload. Correlate a run by plan_id plus created_at, or list codes via GET /v1/projects/{project}/plans/{plan}/access-codes.
  • Per-code redemption fires access_code.redeemed; per-code expiry fires access_code.expired.

How is this guide?

On this page

Subscriby is a product designed by you — for you.

No boardroom full of executives deciding what we ships next. Our roadmap always shaped by you with your feedback.

Share feedback or a request