Overview
Removing user access properly is critical for security, compliance, and data governance. Whether an employee leaves, a contractor's engagement ends, or a user no longer needs access, following a structured offboarding process prevents unauthorized access and ensures continuity of analytics.
This guide covers complete removal, partial access revocation, and post-removal cleanup.
When to Remove Access
Immediate removal required:
- Employee termination
- Security incident or suspected compromise
- Unauthorized access attempt
- Contractor engagement ends
Planned removal:
- Employee leaves company (with notice)
- Role change (no longer needs analytics access)
- Project ends
- Quarterly access review identifies unused accounts
Before You Remove Access
Transfer Ownership of Resources
Dashboards:
- Navigate to Dashboards
- Filter by creator: departing user
- For each dashboard:
- Decide if it's still needed
- Transfer ownership (make team-wide or assign to someone)
- Pin critical dashboards to prevent accidental deletion
- Delete obsolete dashboards
Insights:
- Review insights created by user
- Save important insights to dashboards
- Note: Insights are project-owned, not user-owned (won't be deleted)
Feature flags:
- Go to Feature Flags
- Filter by creator: departing user
- Document purpose and status of each flag
- Update flag metadata to new owner
- Ensure flags won't break if user is removed
Experiments:
- Check active experiments owned by user
- Assign new owner
- Document experiment status and results
API integrations:
- Identify any scripts/tools using user's personal API key
- Replace with new user's API key or project API key
- Test integrations still work
Document Removal
# PostHog Access Removal Log
## Date: 2024-03-31
User: john@example.com
Reason: Left company
Removed by: jane@example.com
Resources transferred:
- 3 dashboards transferred to team
- 2 feature flags documented and reassigned
- 1 active experiment transferred to alice@example.com
- API integration for data export updated
Removing User from PostHog Cloud
Full Removal from Organization
Steps:
- Navigate to Settings → Organization → Members
- Find user in members list
- Click three dots menu → Remove member
- Confirm removal
What happens:
- User loses access to all projects in organization
- User can no longer log in
- Dashboards and insights remain (not deleted)
- User's events remain in database
- Feature flags remain active
Warning: This action is immediate and cannot be undone. User loses access instantly.
Remove from Specific Projects Only
When: User should remain in organization but lose access to certain projects
Steps:
- Navigate to Settings → Project (select project)
- Go to Members
- Find user in project members list
- Click three dots menu → Remove from project
- Confirm removal
User retains:
- Organization membership
- Access to other projects
Example scenario:
Before:
- Production: Member
- Staging: Member
- Development: Admin
After (removed from Production):
- Staging: Member
- Development: Admin
Removing User from Self-Hosted PostHog
Method 1: Via Settings (Recommended)
- Log in with admin account
- Go to Settings → Organization → Members
- Find user and click Remove member
- Confirm removal
Method 2: Via Admin Panel
- Navigate to Admin panel (gear icon)
- Go to Staff users
- Find user
- Click Delete or Deactivate
- Confirm action
Deactivate vs Delete:
- Deactivate: User can't log in, but account preserved (recommended)
- Delete: Permanently removes user account
Method 3: Disable SSO Access
If using SSO:
- Remove user from SSO provider (Okta, Azure AD, etc.)
- Remove PostHog app assignment for user
- User automatically loses access on next login attempt
Note: May take up to 24 hours for SSO changes to propagate.
Revoking API Access
Personal API Keys
User's personal API key stops working immediately when removed from organization.
If scripts/integrations use personal API key:
- Identify affected integrations
- Generate new API key from different user
- Update scripts/tools
- Test integrations
- Then remove user
Project API Keys
Project API keys are NOT affected by user removal. They remain valid.
No action needed unless user has knowledge of project API keys and termination is hostile.
If security concern:
- Rotate project API keys
- Update all SDK configurations
- Deploy updated configurations
- Test that tracking still works
Post-Removal Checklist
Verify removal:
- User removed from organization members list
- User cannot log in (test if possible)
- User removed from all projects
- User removed from Slack analytics channels
- User removed from shared documents/wikis
Transfer resources:
- Dashboards transferred or deleted
- Feature flags reassigned
- Experiments ownership updated
- API integrations migrated
Document:
- Removal logged in access registry
- Reason documented
- Resources transferred noted
- Approver recorded
Security:
- Personal API keys revoked (automatic)
- Project API keys rotated (if needed)
- Access to other tools reviewed (Slack, GitHub, etc.)
Compliance:
- Audit log entry created
- Manager notified
- HR/IT notified (if applicable)
Special Cases
Removing Former Admin
Additional steps:
- Review recent changes: Check audit log for recent admin actions
- Verify configurations: Ensure no malicious changes made
- Rotate secrets: If admin had access to API keys, rotate them
- Review invitations: Check if admin invited unauthorized users
Removing Owner
Critical: Cannot remove last Owner from organization.
Steps:
Promote new Owner first:
- Navigate to Organization → Members
- Promote another admin to Owner
- Verify new Owner can access billing
Then remove old Owner:
- Change old Owner role to Member
- Remove from organization
Must have at least one Owner at all times.
Removing Contractor After Engagement
Checklist:
- Verify contract end date arrived
- Confirm all deliverables received
- Transfer any dashboards/insights
- Remove access
- Document removal
- Archive contract documentation
Communication:
Hi [Contractor],
Your engagement with us has concluded as of [date]. Your PostHog access has been removed.
Thank you for your work on [project]. The dashboards you created have been transferred to our team.
If you have any questions, please reach out within the next 7 days.
Emergency Removal (Security Incident)
Immediate actions:
- Remove from PostHog immediately (don't wait for transfers)
- Revoke all API keys (personal and project if necessary)
- Review audit logs for unauthorized activity
- Check for data exports or unusual queries
- Notify security team
- Document incident
Later:
- Transfer resources (dashboards, flags)
- Review what data user accessed
- Determine if data breach occurred
Bulk User Removal
When: Company restructuring, product sunset, or large team change
PostHog Cloud:
- No bulk removal UI currently
- Remove users one at a time
- For large removals, contact PostHog support
Self-hosted with API:
// Example: Bulk remove users via API
const usersToRemove = [
'user1@example.com',
'user2@example.com',
'user3@example.com'
];
const organizationId = 'your-org-id';
const apiKey = 'your-api-key';
for (const email of usersToRemove) {
await fetch(`https://app.posthog.com/api/organizations/${organizationId}/members/${email}/`, {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${apiKey}`
}
});
console.log(`Removed: ${email}`);
}
Data Retention After Removal
What's deleted:
- User account and login credentials
- User preferences and settings
- Personal API keys
What's kept:
- Events tracked by user (never deleted automatically)
- Dashboards created by user
- Insights created by user
- Feature flags created by user
- Recordings and data user had access to
User's data in analytics:
// Events the user themselves generated are kept
// e.g., if user was also a product user
posthog.capture('button_clicked', {
distinct_id: 'removed_user@example.com'
});
// This event remains in PostHog
To delete user's personal data (GDPR):
- Navigate to Settings → Project → Data Management
- Find Person Deletion
- Enter user's distinct_id
- Confirm deletion
- All events for that distinct_id are deleted permanently
Reactivating Removed User
If user removed by mistake:
PostHog Cloud:
- Cannot undo removal
- Re-invite user as new member
- Re-grant project access
- User gets fresh account (previous settings lost)
Self-hosted:
- If deactivated (not deleted): Reactivate account
- If deleted: Create new account
Note: Dashboards and insights created previously are still there, but user needs to be re-granted access to projects.
Compliance & Auditing
Maintain removal log:
# PostHog Access Removals - Q1 2024
## 2024-01-15: contractor1@agency.com
Reason: Engagement ended
Removed by: jane@example.com
Resources: None (viewer only)
## 2024-02-20: former_employee@example.com
Reason: Left company
Removed by: admin@example.com
Resources:
- 5 dashboards transferred to product team
- 2 feature flags documented
- API export script updated
## 2024-03-10: intern@example.com
Reason: Internship completed
Removed by: manager@example.com
Resources: None
Audit requirements:
- Who was removed and when
- Who performed the removal
- Reason for removal
- What resources were transferred
- Any security incidents
Best Practices
Do:
- Remove access on last day of employment
- Transfer critical resources before removal
- Document all removals
- Review access quarterly and remove unused accounts
- Test that removed users can't log in
- Notify relevant teams (security, HR, IT)
Don't:
- Delay removal (security risk)
- Delete resources that might be needed
- Forget to transfer ownership of critical dashboards
- Remove users without documenting reason
- Skip notification to managers
- Reuse accounts (always create new accounts)
Troubleshooting
Can't remove user:
- Verify you have Owner or Admin role
- Can't remove last Owner (promote someone else first)
- User might be managed by SSO (remove from IdP)
User still has access after removal:
- User may be cached in browser (they'll lose access after logout)
- SSO might not have synced (wait up to 24 hours)
- User might have separate account (check for duplicate emails)
Removed user's dashboards disappeared:
- Dashboards should NOT be deleted on user removal
- Check if dashboards were personal/private (might not be visible)
- Check if someone else deleted them
- Contact PostHog support to investigate
Related Resources
- Add User Access - Onboarding users
- Update Access & Roles - Modifying permissions
- PostHog User Management Overview - General concepts
Need help? Check PostHog user management docs or contact PostHog support.