PLANS / remove-team-member-via-admin-api

Plans

Remove a team member with the Admin API

Enterprise teams can offboard a member over POST https://api.cursor.com/teams/remove-member. Official reference: Admin API → Remove Team Member.

Authenticate with a team Admin API key (Basic auth, key as username, empty password). Rate limit: 50 requests per minute per team. Availability: Enterprise only.

Remove by email

curl -X POST https://api.cursor.com/teams/remove-member \
  -u YOUR_API_KEY: \
  -H "Content-Type: application/json" \
  -d '{
    "email": "developer@company.com"
  }'

Remove by user ID

Use the encoded id from GET /teams/members (same user_… namespace as spend rows).

curl -X POST https://api.cursor.com/teams/remove-member \
  -u YOUR_API_KEY: \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "user_PDSPmvukpYgZEDXsoNirw3CFhy"
  }'
Field Rules
userId Encoded user ID. Required if email is omitted
email Member email. Required if userId is omitted

Send either userId or email, never both.

Success response

{
  "success": true,
  "userId": "user_PDSPmvukpYgZEDXsoNirw3CFhy",
  "hasBillingCycleUsage": true
}
Field Meaning
success Removal succeeded
userId Encoded id of the removed member
hasBillingCycleUsage Whether that member has usage in the current billing cycle

Constraints the API enforces

  • At least one paid member must remain on the team after removal
  • At least one admin (owner or free-owner) must remain after removal

Documented errors

{ "error": "User is not a member of this team" }
{ "error": "Either userId or email must be provided" }
{ "error": "Only one of userId or email should be provided, not both" }

Pitfalls

  • Sending both userId and email in one body — the API rejects the request
  • Removing the last paid member or the last owner/free-owner — the call fails the remaining-admin / remaining-paid checks
  • Looking up numeric userId from daily-usage rows for this route — remove-member wants the encoded user_… id (or email)