Programmatically Manage Claude Enterprise Teams and Roles
Automate enterprise user management via the Claude Admin API.
Leverage the new Admin API to programmatically manage invites, roles, and group memberships for Claude Enterprise organizations.
The Scenario
Your company has just offboarded several employees, and you need to ensure their access to the Claude Enterprise environment is revoked immediately across all groups.
Before & after
Admins had to manually click through the Claude Console UI to invite, remove, or change roles for every individual employee. This could take 30–60 minutes for a medium-sized team.
Use the Admin API to programmatically list members, change roles, or audit access levels across the organization in 1–2 minutes via a script.
The Prompt
Act as an IT automation expert. Write a Python script using the Claude Admin API to list all users in my Claude Enterprise organization and identify any users who do not belong to the '[DEPARTMENT_NAME]' group. Use the 'anthropic-beta: ce-user-management-2026-07-13' header where necessary.
The Admin API is in beta for Claude Enterprise. It allows for advanced management including group membership and custom roles. Note that some requests (groups/custom roles) require the 'anthropic-beta: ce-user-management-2026-07-13' header.
Source
Claude Platform release notes - Claude Platform Docs"You can now manage the people in your Claude Enterprise (claude.ai) organization with the Admin API... list members, change roles, remove members."
