Notify Certificate Code
API Reference
Notify Certificate Code
Report a certificate code as sent to a recipient or activated by them.
Called by the external agent that distributes codes:
>>> POST /certificate-codes/HAIQU2026HAVEFUN00/notify
>>> {"status": "sent", "user_email": "participant@example.com"}
Repeating a notification is not an error — the first ``sent_at`` /
``activated_at`` timestamp is kept, and only the recipient is refreshed.
``activated`` requires a ``user_email`` that belongs to an existing Haiqu
user; the code is linked to that user. ``sent`` accepts any recipient,
including none.
Args:
code (str): The certificate code (case-insensitive).
notification (CertificateCodeNotifyModel): Reported status and the email the
code was sent to / activated by (required for ``activated``).
Returns:
CertificateCodeModel: The updated code.
Raises:
HTTPException: Raised with ``404`` when the code does not exist or when
``activated`` names an email with no Haiqu user, or with ``409`` when
the reported status would undo a later one.
POST
Notify Certificate Code
Authorizations
Path Parameters
Body
application/json
Response
Successful Response
The Pydantic model for a certificate code stored in the DB.
Lifecycle of a certificate (invitation) code.
Available options:
created, sent, activated