Skip to main content
Legitmark sends three event types. Every webhook destination receives all events automatically.

state_change

Sent when a service request transitions to a new state. This is the primary event for tracking authentication progress and results.

Payload

Fields

string
required
Always "state_change".
string
required
Service request UUID.
string | null
Your internal item ID — the external_id you set when creating the service request.
object
required
string
required
ISO 8601 timestamp of when the state change occurred.

State Transitions

The table below shows the state transitions you may receive:
The most important transition is COMPLETE + APPROVED or COMPLETE + REJECTED — this is the final authentication result. See Service Request States for the full state machine.Using the TypeScript SDK (v0.2.0+), you can check these with isAuthentic(event) and isCounterfeit(event) instead of comparing strings manually. See Handling Webhooks.

media_rejected

Sent when uploaded images fail quality control. Each rejected image includes the side UUID and the rejection reason. Use that UUID when uploading the replacement photo.

Payload

Fields

string
required
Always "media_rejected".
string
required
Service request UUID.
string | null
Your internal item ID.
array
required
Array of rejected images with reasons.
string
required
ISO 8601 timestamp.
When you receive a media_rejected event, the service request is QC / REJECTED. Upload a new photo for each entry in sides, using side as the side UUID, then call POST /api/v2/sr/{sr_uuid}/resubmit. That call moves the request back to QC / PENDING.POST /submit applies only while the service request is DRAFT. From QC / REJECTED it returns 400 with Cannot submit: Service request is not in DRAFT state.
Using the TypeScript SDK, needsResubmission(event) returns true for this event type. See Handling Webhooks.

invalidate_sr

Sent when a service request is cancelled.

Payload

Fields

string
required
Always "invalidate_sr".
string
required
Service request UUID.
string | null
Your internal item ID.
object
required
string
required
ISO 8601 timestamp.