Skip to main content
This guide walks you through collecting your first user consent and querying their data.

Connect your AI tools

Get AI-powered help while integrating by connecting these docs to your AI tools.
Add to .cursor/mcp.json:

Prerequisites

The Control Room account with API credentials
Don’t have an account? Sign up here.

Step 1: Configure your flow

Set up your company branding for the consent flow.
POST /configs is an upsert. Reusing the same config_name updates the existing config instead of returning a conflict, which makes setup scripts idempotent. Use GET /configs to list your configs and preview URLs.
Create an HMAC-signed URL that users click to start the consent flow.
Do not ask end-users for uid or collect it in the frontend. Use your internal user id server-side or omit uid and store the generated callback uid. This keeps user scoping private and avoids wrong-user data access.

Step 3: Handle the callback

After the user completes the consent flow, they’re redirected to your redirect_uri with these parameters:

Step 4: Check export status

Before querying, poll GET /export/status/{uid} until the provider you need is ready.

Response example

You can also subscribe to data.ready and data.failed webhooks for near-real-time export updates. Keep polling GET /export/status/{uid} as a fallback for missed webhook deliveries.

Step 5: Query user data

Once consent is granted and data is exported, query it using the sync endpoints.

Common mistakes to avoid

  • Using https://link.emergedata.ai/link instead of https://link.emergedata.ai/link/start
  • Signing URL parameters in the wrong order or signing URL-encoded values
  • Treating state as a user identifier or skipping state verification
  • Asking users to input uid or failing to store the callback uid
  • Querying before GET /export/status/{uid} shows data_ready: true for your provider
  • Exposing signing_secret or API tokens in client-side code

Next steps

Link Guide

Deep dive into consent flow options

Query Guide

Learn about sync vs async queries

Webhooks

Track consent and data export lifecycle changes

SDK Reference

Full SDK implementation examples