Skip to main content
Account events alert you when an end-user’s stored EHR credentials need attention. They’re not tied to a specific operation — Cobalt fires them when it detects a credential issue, whichever request or sync was running at the time. There are two kinds of account event. Login events fire when a credential can no longer sign in to the EHR, or soon won’t be able to:
  • access_token.login_required — credentials are no longer valid; the user must re-authenticate via Cobalt Link before further operations can succeed.
  • access_token.password_change_warning — the EHR is prompting the user to change their password. Re-authenticate proactively to avoid an interruption.
For both, surface data.message to the affected user and direct them to Update Mode to refresh their credentials. Data model access events fire when a credential can still sign in, but the EHR denies it access to one kind of data, such as payments or claims:
  • data_model.access_denied — a credential was denied read or write access to a data model. Other credentials on the connection keep working.
  • data_model.sync_disabled — every credential assigned to a data model has been denied read access, so Cobalt has turned off scheduled read sync for that data model on the connection.
These are fixed in the EHR, not through Link: give the user the missing permission in the EHR, then reset access in the Cobalt dashboard. See Data model access events.

Identifying the credential

A connection can hold more than one set of EHR credentials, and a login event is always about exactly one of them. Both login events carry credential_id, the ID of that credential set, so you do not have to guess which login needs attention. Data model access events carry their credential IDs inside data instead; see their envelope. credential_id is also the ID the credential endpoints take, so you can act on the credential straight from the event: The last active credential set on a connection cannot be disabled or deleted.
credential_id is present on the envelope and repeated inside data. Treat it as nullable: in the rare case where Cobalt cannot resolve the credential set behind an event, it is null. Fall back to access_token_id to identify the connection.

Payload Envelope

Login events use this envelope:

Event Types

Triggered when an end-user’s stored EHR credentials are no longer valid (e.g. password changed in the EHR, account locked, or password expired). The user must re-authenticate via Cobalt Link before further operations can succeed.Payload Example:
Data Fields:
Triggered when an EHR prompts the user to change their password but the prompt was deferred. This is an early warning that a password change will be required soon.Payload Example:
Data Fields:

Data model access events

An EHR user account can be allowed to sign in but still be blocked from part of the EHR, for example by a missing security key or role. When Cobalt sees the EHR deny a credential access to a data model, it records that against the credential, the data model and the operation (read or write) separately, and stops using that credential for that data model and operation until access is reset. Other credentials on the connection, other data models, and the other operation are unaffected. The events report a change of state, not every failed request:
  • data_model.access_denied fires when a credential moves to denied for a data model and operation. Cobalt confirms the denial before recording it, so a single failed request may not trigger it. It does not fire again while the credential stays denied.
  • data_model.sync_disabled fires when every credential assigned to a data model is denied read access (for example, once the last credential that still had access is denied or deleted) and Cobalt turns off scheduled read sync for that data model. It is always about read. Writes and other data models keep working.
Neither event means the credential can no longer sign in; that is access_token.login_required. Neither is the result of an operation either: they never carry a job_id, and a request that ran into the denial still gets its own operation event. While read sync is off for a data model, list and get requests for it keep returning the data Cobalt already holds, with an explanation in the response’s warnings array and Cobalt-Warning header.

Restoring access

  1. Give the EHR user the permission it is missing, in the EHR. data.capability names the data model and data.operation says whether reading or writing it was denied.
  2. In the Cobalt dashboard, open the connection from Linked Accounts and go to its API Access tab. The affected data model shows its read or write access as degraded or blocked, with the denied credentials.
  3. Click Reset read access or Reset write access. If read sync was turned off, the button is Reset read access and re-enable sync.
Resetting lets Cobalt try the credentials again. It does not replay requests that already failed. If the EHR still denies access, Cobalt records the denial again and sends a new event.

Data model access envelope

Data model access events are delivered to the webhook URLs registered on your account, never to the callback_urls of a request. Their envelope differs from the login events: it carries action, and it has no access_token_reference_id or top-level credential_id. Use access_token_id to identify the connection.

Data model access event types

Triggered when a credential moves to denied access for one data model and operation. Cobalt stops using that credential for that data model and operation; the connection’s other credentials remain usable. This event alone does not mean sync is disabled.Payload Example:
Data Fields:
Triggered when every credential assigned to a data model has been denied read access and Cobalt turns off scheduled read sync for that data model on the connection. Writes and other data models are unchanged. Restore the EHR permissions, then re-enable sync from the dashboard as described in Restoring access.Payload Example:
Data Fields:There is no credential_id on this event, because it is about all of the data model’s credentials rather than one.