Sidelatch Docs
Docs menu

View as Markdown

Reference

Events

Every event type and its payload: server events and connect window events.

Server events

An event is recorded for everything that happens to a connection, a sign-in or an async run, whether or not you have a webhook. List them for 30 days. Set webhook_url in settings and each one is also POSTed to you. Events carry ids and statuses only, never portal data or credentials.

EventWhendata
connection.connectedA user linked an account, or signed in again on one that needed it (relinked: true).connection_id, user_id, portal, status, relinked
connection.reconnect_neededThe portal refused the stored login and only the user can fix it. Sent once, when the status changes.connection_id, user_id, portal, status, reason
connection.deletedA connection was disconnected and its stored login deleted.connection_id, user_id, portal, status
link.challenge_requiredDuring sign-in, the portal asked the user for a step: a code, a choice, a phone approval, security questions or a CAPTCHA.user_id, portal, kind
link.failedA sign-in did not finish. reason is auth_failed (wrong password or code), blocked (the portal wants a check on its own page), abandoned (the user left the hosted browser) or busy.user_id, portal, reason
run.completedAn async run finished. Read the result with GET /v1/runs/{id}.run_id, connection_id, user_id, portal, operation, status
run.failedAn async run failed. error is one of the error codes.run_id, connection_id, user_id, portal, operation, status, error
build.completedA portal build finished: status is ready, partial, needs_operator or published.build_id, status, portal
webhook.testYou sent a test event from the console or the API.message
Event body{
  "id": "evt_1f0c...",
  "type": "connection.reconnect_needed",
  "created": 1795700000,
  "data": {
    "connection_id": "conn_8f2c41d07a9b4e6f",
    "user_id": "agency-42",
    "portal": "demo_carrier",
    "status": "reconnect_needed",
    "reason": "wrong_password"
  }
}

Every event has the same envelope: id, type, created (unix seconds) and data, whose fields are listed above. The API also returns object, created_at and the delivery attempts.

Connect window events

The connect window reports to your page as it goes: link.js and @sidelatch/link pass these to onEvent(name, data), for your own funnel analytics. They never carry a login or anything the portal returned.

NameWhendata
openedThe sign-in form is showing.{}
submittedThe user sent their login.{}
challengeThe portal asked for a verification step.{kind}: code, choice, push, questions or captcha
browserThe portal's own sign-in page opened in a hosted browser.{}
errorSomething went wrong; the user can usually try again.{code, message}, code from the error codes
connectedThe account is linked. onSuccess(connectionId, {portal}) follows.{connectionId, portal}
exitThe window closed without a connection. onExit(error) follows.{error}: the last {code, message}, or null

If you embed /connect in your own iframe instead, these arrive as postMessage data: {type: "sidelatch:event", name, ...data}, {type: "sidelatch:connected", connection_id, portal} and {type: "sidelatch:exit", error}. Check that event.origin is your Sidelatch host before you trust one.