Skip to main content
DELETE
/
api
/
open
/
workspaces
/
{workspaceId}
/
users
/
{userId}
curl -X DELETE https://api.opnform.com/api/open/workspaces/123/users/456 \
  -H "Authorization: Bearer YOUR_API_TOKEN"
{
  "message": "User removed from workspace successfully."
}
This endpoint removes a user from a workspace. The user will lose all access to the workspace’s forms, submissions, and settings.

Authentication

Requires authentication via Bearer token or Sanctum session.

Authorization

The authenticated user must have the adminAction permission for the workspace. This requires:
  • User must be an admin in the workspace
  • Only admins can remove users

Path Parameters

workspaceId
string
required
The ID of the workspace
userId
string
required
The ID of the user to remove from the workspace

Behavior

  • The user is immediately removed from the workspace
  • The user can no longer access any forms or submissions in this workspace
  • The user’s role and permissions in the workspace are deleted
  • If this was the user’s only workspace, a new default workspace is created for them
  • Forms created by the user remain in the workspace
  • Historical data (form submissions, audit logs) remain intact

Response

message
string
Success message confirming the user was removed
curl -X DELETE https://api.opnform.com/api/open/workspaces/123/users/456 \
  -H "Authorization: Bearer YOUR_API_TOKEN"
{
  "message": "User removed from workspace successfully."
}

Important Notes

Cannot Remove Yourself

You cannot remove yourself from a workspace using this endpoint. Use the Leave Workspace endpoint instead.

Last User Protection

If you attempt to remove the last user from a workspace, the system ensures the user has at least one workspace by creating a new default workspace for them.

Billing Impact

Removing users from a workspace may affect billing:
  • Workspaces on Pro plans are billed per workspace, not per user
  • Removing users does not reduce the workspace’s subscription cost
  • The removed user’s personal workspace subscription (if any) is unaffected

Forms and Data Retention

  • Forms: Forms created by the removed user remain in the workspace
  • Submissions: All form submissions are retained
  • Integrations: Integrations configured by the user remain active
  • OAuth connections: OAuth connections owned by the removed user may need to be reconfigured

Re-adding Users

To re-add a removed user:
  1. Use Add Workspace User with the user’s email
  2. The user will be added immediately (no invitation needed for existing users)
  3. Specify their new role

Best Practices

Before Removing a User

  1. Review ownership: Check what forms and integrations the user owns
  2. Transfer OAuth connections: If the user connected OAuth providers (Google Sheets, etc.), have another admin reconnect them
  3. Communicate: Inform the user they’re being removed from the workspace
  4. Document: Record why the user was removed for audit purposes

After Removing a User

  1. Verify access: Confirm the user can no longer access the workspace
  2. Review integrations: Check that all integrations still work (especially OAuth-based ones)
  3. Update documentation: Update any team documentation that references the removed user

Security Considerations

  • Only workspace admins can remove users
  • Removed users cannot access any workspace data
  • API tokens generated by the removed user for this workspace are immediately invalidated
  • Webhook signatures and integration credentials remain valid unless regenerated

Audit Trail

Workspace user removals are logged in the system for audit purposes. While not exposed via API, OpnForm maintains internal logs of:
  • Who removed the user
  • When the user was removed
  • The user’s role at the time of removal

Build docs developers (and LLMs) love