Publish and discover a Hub
In Embeddings, publish the integrations, branding and requested consent purposes. Approve exact HTTPS embedding origins and return URLs. AMLOK rejects wildcard origins, embedded URL credentials, fragments and unregistered destinations. Sandbox alone may permit explicitly registered loopback HTTP origins for development; Live requires HTTPS. ReadGET /v1/configuration. Each embedding_versions entry lists its ID, integrations, consent purposes, allowed origins, return URLs and hub_origin. Publishing a new version does not change existing sessions. Use a version whose integration set and purposes fit the borrower flow.
Create the session on your server
Authenticate your own customer and authorize their relationship to the borrower before callingPOST /v1/embedding-sessions. Keep the API key on the server. Send borrower_id, embedding_version_id, purpose, return_url, consent_purposes and, for an iframe, embed_origin.
- Request credit_assessment for underwriting.
- Request continuous_monitoring for post-funding monitoring.
- Request both if the borrower is explicitly consenting to both. The Hub presents both purposes; neither implies the other.
- Requested purposes must be a subset of the published Hub’s allowed purposes. Otherwise return 422 consent_purpose_missing.
- For reauthorization, use purpose reauthorize and the affected connection_id. Consent can be renewed only with a new affirmative borrower authorization.
Display the borrower experience
Use launch_url for either full-page navigation or an iframe. A session without embed_origin is redirect-only. The Hub uses a frame-ancestors policy allowing the approved parent origin; API endpoints do not enable browser CORS for secret keys. Allow the configured hub_origin in your application’s frame-src policy.*.
Validate event.origin against the configured hub_origin, event.source against the iframe’s contentWindow, and session_id against the session your backend created. Deduplicate event_id. No message includes provider tokens, financial data or proof of consent. Your backend retrieves the session before trusting a terminal state.
For full-page presentation, terminal states return the browser to the approved return_url with amlok_session_id and amlok_state added as query parameters. These reserved parameters cannot be supplied in the configured URL. Treat them as untrusted hints; your authenticated backend verifies session ownership and retrieves its state. Cancelled and expired sessions require a new session. Already confirmed consent/connections are not revoked by closing the window.