Directory Sync

Directory Sync

Directory Sync keeps your app's users and groups in step with your customer's directory. When their IT admin adds, updates or removes someone, OrbitID receives the change and forwards it to you as a webhook. You can also query the synced users and groups with the API.

With your coding agent

Claude Code, Cursor or Codex makes the change in your repo and tells you what it touched.

Sync our customers' directories into this app with OrbitID. Follow https://orbitid.com/docs/directory-sync.md

1. Add POST /webhooks/orbitid and verify OrbitID-Signature with ORBITID_WEBHOOK_SECRET.
2. Map each event's tenant to our organization. Create users on user.created, update them on user.updated, deactivate them on user.deleted or active: false. Never hard-delete.
3. If this app has teams or roles, mirror groups and memberships from the group.* events.
4. Make every handler idempotent and return 200 fast; the body can be an array of events.
5. Run the tests, then list what you changed and which events you ignore.

Supported directories

DirectoryHow it connects
OktaSCIM 2.0
Microsoft Entra IDSCIM 2.0
OneLoginSCIM 2.0
JumpCloudSCIM 2.0
Any SCIM 2.0 directorySCIM 2.0
Google WorkspaceOAuth (OrbitID polls the Google Directory API)

Create a directory

In the dashboard open the environment, go to Directory Sync and click New directory. Choose the provider, enter the tenant it belongs to and, optionally, a webhook URL and secret. For SCIM providers the dashboard then shows:

  • the SCIM endpoint: https://app.orbitid.com/api/scim/v2.0/<directoryId>
  • a bearer token that the directory uses to authenticate. It is shown once, so copy it into the identity provider straight away.

Give both values to your customer's IT admin, or follow the provider guide together. For Google Workspace there is no SCIM endpoint: click Connect and sign in with a Google Workspace admin account instead.

One directory counts as one connection for billing.

Events

OrbitID emits these events as the directory changes:

EventWhen
user.createdA user was provisioned
user.updatedA user's attributes changed, including activation and deactivation
user.deletedA user was removed
group.createdA group was pushed
group.updatedA group was renamed or changed
group.deletedA group was removed
group.user_addedA user was added to a group
group.user_removedA user was removed from a group

Each event is delivered to the directory's webhook, signed with the directory's secret in the OrbitID-Signature header. Payloads and verification are described in Webhooks. Turn on Log webhook events on the directory to see every delivery and its response in the dashboard.

Query synced data

Use an API key to read what has been synced:

curl "https://app.orbitid.com/api/v1/dsync/users?tenant=acme&directoryId=<directoryId>" \
-H "Authorization: Bearer orb_live_..."
  • GET /api/v1/dsync – list directories; GET /api/v1/dsync/<directoryId> – one directory.
  • GET /api/v1/dsync/users and GET /api/v1/dsync/users/<userId> – synced users.
  • GET /api/v1/dsync/groups, GET /api/v1/dsync/groups/<groupId> and .../members – synced groups.
  • GET /api/v1/dsync/events and GET /api/v1/dsync/events/<eventId> – webhook event log.