Webhook V2
Webhook v2 is a key update to our notification system, designed to provide greater security and granularity for events in the Magic Link flow.
The previous version (v1), configured within the Magic Link request's metadata, became unscalable: it lacked authentication and could only send the generic track and results events.
Webhook v2 solves this:
Security and Authentication: Webhook v2 configuration requires an active Service Account (provided by Unico) to ensure you receive events securely.
Scalability and Detail: It is designed to allow sending more detailed events in the future. For example, you will now be able to obtain specific information such as the document capture's re-take reason, a detail that was inaccessible in v1.
Considerations
Webhook v2 configuration is not done directly via the API.
Configuration Precedence: To ensure compatibility with existing integrations, the webhook configuration set in the
metadataof a Magic Link request (v1) will always take the highest precedence over any Webhook v2 configuration.No Overriding: The global Webhook v2 configuration does not override webhook configurations made directly via the API for specific Magic Links.
Configuration parameters
Activation: Request configuration from your assigned Onboarding Project Manager, providing:
URL: The url to use as a webhook.
Auth type: The type of authentication for the webhook (
basic_auth,api_key,oauth2orNoAuth):basic_auth: Requires user and password.api_key: Requires the header name and header value.oauth2: Requieres the url to authenticate, theclient_idand theclient_token.NoAuth: Does not perform any type of authentication.
Auth config: The configuration mentioned before.
Max retry attemps: The max number of attempts to make a request to the webhook.
Retry interval seconds: The wait time to retry the request to the webhook.
Timeout seconds: The TTL before ending the connection to the webhook.
Webhook Events
Currently we only support 3 types of events:
1- MAGIC_LINK_RESULTS
This event is sent at the end of the flow, when the Decision Maker has finished processing the information sent. This is an example of the request sent to the webhook:
2 - MAGIC_LINK_TRACK
These events are received when the user completed an action, for example, form_start will be received when the user is taking the front document, which means that the user clicked and completed the first screen
Key Table
step
Name of the previous completed step.
user_id
The external_id you set in the magic link.
started_on
UTC timezone. Step starting time.
completed_on
UTC timezone. Step completion time.
Steps Table
form_start
The user clicked the first magic link button presented on the screen
form_document_front
The user has completed the INE front process
form_document_back
The user has completed the INE back process
form_document
The user has completed both front and back processes
form_selfie
The user has completed the liveness process
form_decision_maker
The user has completed the flow
3 - MAGIC_LINK_DOCUMENT_RETAKE_REASONS
This event is sent when a document re-capture is required, either during the front or back process. It indicates that critical data from the INE could not be read.
Error Combinations and Examples (Payloads)
The payload is designed so that only one error (true) is received for each document side. The specific examples are shown below:
Failures on the Document Front (document_type: "ine_front")
document_type: "ine_front")Invalid Document
CURP Reading Failure
Failures on the Document Back (document_type: "ine_back")
document_type: "ine_back")Invalid Document
MRZ Reading Failure (OCR)
Last updated