PLANS / manage-team-directory-group-members-via-admin-api

Plans

Manage team directory group members with the Admin API

List members with GET https://api.cursor.com/teams/directory-groups/:groupId/members, add with POST …/members/bulk-add, and remove with POST …/members/bulk-remove. Official reference: Admin API → List / Add / Remove Team directory group members.

Authenticate with a team Admin API key (Basic auth, key as username, empty password). Reads need read:*; writes need admin:*. Rate limit: 20 requests per minute per team.

:groupId must be the directory-group public id (team_group_…). Member ids are public user_… values — the same namespace as GET /teams/members.

SCIM-synced groups reject manual membership changes with 400. Manage those members in your identity provider.

List members

curl -X GET "https://api.cursor.com/teams/directory-groups/team_group_01k2ja2000e0080000000000n2/members?page=1&pageSize=50" \
  -u YOUR_API_KEY:

page defaults to 1. pageSize defaults to 50 and clamps at 200.

{
  "members": [
    {
      "userId": "user_abc123",
      "name": "Alex Developer",
      "email": "alex@company.com",
      "joinedAt": "2026-01-15T10:30:00.000Z"
    }
  ],
  "pagination": {
    "page": 1,
    "pageSize": 50,
    "totalCount": 1,
    "totalPages": 1,
    "hasNextPage": false,
    "hasPreviousPage": false
  }
}

Add members

Up to 100 user_… ids per request.

curl -X POST https://api.cursor.com/teams/directory-groups/team_group_01k2ja2000e0080000000000n2/members/bulk-add \
  -u YOUR_API_KEY: \
  -H "Content-Type: application/json" \
  -d '{
    "userIds": ["user_abc123", "user_def456"]
  }'
{ "addedCount": 2 }

addedCount only counts new memberships. Users outside the team and users already in the group are ignored and do not inflate the count.

Remove members

curl -X POST https://api.cursor.com/teams/directory-groups/team_group_01k2ja2000e0080000000000n2/members/bulk-remove \
  -u YOUR_API_KEY: \
  -H "Content-Type: application/json" \
  -d '{
    "userIds": ["user_def456"]
  }'
{ "removedCount": 1 }

Users who are not in the group are ignored. Empty the group with bulk-remove before you can DELETE the group itself.

Resolve user ids

curl -X GET https://api.cursor.com/teams/members \
  -u YOUR_API_KEY:

Use each row's id (user_…) in userIds. Do not pass the numeric userId from daily-usage rows.

Pitfalls

  • Calling bulk-add or bulk-remove on a SCIM-synced group — expect 400
  • Passing Billing Group or Organization Group ids as :groupId
  • Assuming ignored users raise an error — they are skipped silently and only the count reflects real changes