Preview what removing a member stops

The enabled schedules in TEAM spaces that removeMember would disable for this member, in one list whatever the cause: actor_left_org for a schedule the member is the actor of, connection_unshared for another actor's schedule whose connection_overrides name a connection the member shares into that space (the removal withdraws every share of the member's connections). Each item's lost_integrations lists the integrations whose named connection belongs to the departing member: reassigning the schedule to another member (updateSchedule) is not enough there, a replacement connection is needed too. Read with the same selectors the removal uses, without writing anything: a snapshot, which a later change can make stale before the removal runs. Schedules in personal spaces are left out — the departing member's personal space enters its 30-day offboarding window and an administrator cannot read a live one. A credential confined to spaces (a space-bound token, the chat's bearer) sees only the items in the spaces it may name. Known limit: a binding to the member's connection outside the schedule's own connection_overrides — an admin pin, an organization default, or a member pin of the departing member — is not listed, and is not disabled by the removal either (the schedule fails at resolution). Same guard and same per-target rule as removeMember: 404 when the user is not a member, 403 when the caller could not remove them (an admin previewing an owner, any token previewing an owner).

GET/api/orgs/{orgId}/members/{userId}/departure-impact

Authorization

better-auth.session_token<token>

Cookie session from Better Auth. Requires X-Org-Id header for org-scoped routes.

In: cookie

Path Parameters

orgId*string
userId*string
curl -X GET "https://your-instance/api/orgs/string/members/string/departure-impact"
{
  "object": "list",
  "hasMore": false,
  "data": [
    {
      "id": "sch_abc123",
      "name": "Daily digest",
      "space": {
        "id": "spc_team",
        "name": "Sales"
      },
      "packageId": "@acme/digest",
      "actor": {
        "type": "user",
        "id": "usr_def456",
        "name": "Bob"
      },
      "cause": "actor_left_org",
      "lost_integrations": [
        "@acme/gmail"
      ]
    }
  ]
}
{
  "type": "https://docs.appstrate.dev/errors/unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Invalid or missing session",
  "code": "unauthorized",
  "request_id": "req_abc123"
}
{
  "type": "https://docs.appstrate.dev/errors/forbidden",
  "title": "Forbidden",
  "status": 403,
  "detail": "Insufficient permissions",
  "code": "forbidden",
  "request_id": "req_abc123"
}
{
  "type": "https://docs.appstrate.dev/errors/not-found",
  "title": "Not Found",
  "status": 404,
  "detail": "Resource not found",
  "code": "not_found",
  "request_id": "req_abc123"
}