> **Building with AI coding agents?** If you're using an AI coding agent, install the official Scalekit plugin. It gives your agent full awareness of the Scalekit API — reducing hallucinations and enabling faster, more accurate code generation.
>
> - **Claude Code**: `/plugin marketplace add scalekit-inc/claude-code-authstack` then `/plugin install <auth-type>@scalekit-auth-stack`
> - **GitHub Copilot CLI**: `copilot plugin marketplace add scalekit-inc/github-copilot-authstack` then `copilot plugin install <auth-type>@scalekit-auth-stack`
> - **Codex**: run the bash installer, restart, then open Plugin Directory and enable `<auth-type>`
> - **Skills CLI** (Windsurf, Cline, 40+ agents): `npx skills add scalekit-inc/skills --list` then `--skill <skill-name>`
>
> `<auth-type>` / `<skill-name>`: `agent-auth`, `full-stack-auth`, `mcp-auth`, `modular-sso`, `modular-scim` — [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Remove users from organizations

As your application grows and teams evolve, your administrators will need to manage user access when employees leave, change roles, or when administrators need to revoke access for security reasons. Proper user removal ensures that access control remains accurate, licenses are managed efficiently, and security is maintained across your organization.

When a user is removed from an organization, they immediately lose access to that organization's resources. The user's account remains in Scalekit, but their membership status changes, and they can no longer access organization-specific data or features.

- User loses access to ONE specific organization
- User account remains in Scalekit
- User can still access OTHER organizations they belong to
- Reversible - user can be re-added later

```javascript title="Remove users from organizations" wrap
// Use case: Remove user during offboarding workflow triggered by HR system
await scalekit.user.deleteMembership({
  organizationId: 'org_12345',
  userId: 'usr_67890'
})
```

  ```python title="Remove users from organizations" wrap
# Use case: Remove user during offboarding workflow triggered by HR system
scalekit_client.users.delete_membership(
    organization_id="org_12345",
    user_id="usr_67890"
)
```

  ```go title="Remove users from organizations" wrap
// Use case: Remove user during offboarding workflow triggered by HR system
err := scalekitClient.User().DeleteMembership(ctx, "org_123", "user_456", false)
if err != nil {
    log.Printf("Failed to remove user: %v", err)
    return err
}
```

  ```java title="Remove users from organizations" wrap
// Use case: Remove user during offboarding workflow triggered by HR system
try {
    scalekitClient.user().deleteMembership("org_123", "user_456");
} catch (Exception e) {
    log.error("Failed to remove user: " + e.getMessage());
    throw e;
}
```

  The membership is removed, effectively dropping the user's access to the specified organization.

```json del={24-39} collapse={42-50, 3-8}
{
    "user": {
        "id": "usr_96194455173857548",
        "environment_id": "env_58345499215790610",
        "create_time": "2025-10-25T14:46:03.300Z",
        "update_time": "2025-10-31T11:33:31.639425Z",
        "email": "saifshine7+locksmith@gmail.com",
        "external_id": "hitman",
        "memberships": [
            {
                "organization_id": "org_96194455157080332",
                "membership_status": "ACTIVE",
                "roles": [
                    {
                        "id": "role_69229687729029148",
                        "name": "admin",
                        "display_name": "Admin"
                    }
                ],
                "name": "",
                "metadata": {},
                "display_name": ""
            },
            {
                "organization_id": "org_67609586521080405",
                "membership_status": "PENDING_INVITE",
                "roles": [
                    {
                        "id": "role_69229700009951260",
                        "name": "member",
                        "display_name": "Member"
                    }
                ],
                "name": "Megasoft Inc",
                "metadata": {},
                "display_name": "Megasoft Inc",
                "created_at": "2025-10-31T12:38:42.270Z",
                "expires_at": "2025-11-15T12:38:42.231316Z"
            }
        ],
        "user_profile": {
            "id": "usp_96194455173923084",
            "first_name": "Saif",
            "last_name": "Shines",
            "name": "",
            "locale": "",
            "email_verified": true,
            "phone_number": "80384873",
            "metadata": {},
            "custom_attributes": {}
        },
        "metadata": {}
    }
}
```

User removal from an organization involves several important considerations and behaviors.
- When a user is removed from an organization and has no other organizational memberships, Scalekit will automatically delete their user account.
- Your application is responsible for handling the transfer or deletion of the user's resources when they are removed from an organization.
- Scalekit immediately terminates the user's active session upon removal from an organization.
- Removing a user from one organization does not impact their memberships in other organizations.
- When a user is removed from an organization, that organization will be automatically removed from the user's organization switcher options.

## Automate user removal with directory sync

When organizations use enterprise directory providers with [SCIM provisioning](/guides/user-management/scim-provisioning/), users are automatically removed from Scalekit organizations when they're deprovisioned in the source directory. This ensures consistent access control across all systems without requiring manual intervention.

When a user is removed from your enterprise directory provider (such as Okta, Azure AD, or JumpCloud):

1. The directory provider sends a SCIM DELETE request to Scalekit
2. Scalekit automatically removes the user's membership from the organization by marking the `memberships.membership_status` as `INACTIVE`
3. The user immediately loses access to organization resources
4. Your application receives webhook notifications about the membership change

This automation is particularly valuable for enterprise customers who manage large numbers of users and need to ensure that license allocation and access control remain synchronized with their directory provider.
**Early access:** De-provisioning via SCIM is currently in limited release. Interested in activating this feature for your Scalekit environment? [Reach out to our team](/support/contact-us) to request early access.

## Remove users in the Scalekit dashboard

Use the Scalekit dashboard when administrators need to manually remove users for compliance, security, support or administrative purposes. This approach provides direct control and visibility into the removal process, making it ideal for situations requiring manual oversight.

1. Sign in to the Scalekit dashboard and navigate to **Dashboard** > **Organizations**. Select the organization from which you want to remove users.

2. Click on the **Users** tab to view all organization members. Locate the user you want to remove from the user list. You can use the search functionality to quickly find specific users by name or email.

3. Click the **Actions** menu (three dots) next to the user's name and select **Remove from organization**. A confirmation dialog will appear to prevent accidental removals.

4. Review the confirmation dialog to ensure you're removing the correct user. Click **Remove user** to confirm. The user will immediately lose access to the organization and its resources.

---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
