Skip to main content
OpenAPI

Members API

Endpoints for querying organization members, updating their roles, and managing member statistics and quotas.

List members

GET /v1/organizations/{org_id}/members
Query parameters:
ParameterTypeDescription
userIdstringExact user UUID lookup; cannot be combined with email
emailstringExact match on email address
includeDeletedbooleanInclude deleted members; defaults to false
maxResultsintegerItems per page; default 20, max 100
nextTokenstringPagination cursor
userId must be a non-empty standard UUID. Exact lookup by userId or email returns at most one member and does not return a new nextToken. If no member matches, the API returns 200 OK with an empty members array. Request example:
curl -X GET "https://api.qoder.com.cn/v1/organizations/org_xxx/members?maxResults=10" \
  -H "Authorization: Bearer <api_key>"
Response example:
{
  "members": [
    {
      "id": "member_001",
      "userId": "550e8400-e29b-41d4-a716-446655440000",
      "email": "user@example.com",
      "name": "Alice Zhang",
      "role": "org_member",
      "status": "ENABLED",
      "joinedAt": "2025-01-10T08:00:00Z"
    }
  ],
  "maxResults": 10,
  "nextToken": "token_abc"
}

Member status values

StatusDescription
ENABLEDActive
DISABLEDDisabled
UNACTIVATEDNot yet activated
APPROVE_PENDINGPending approval
APPROVE_DECLINEDApproval declined
DELETEDDeleted

Get member details

GET /v1/organizations/{org_id}/members/{member_id}
Request example:
curl -X GET "https://api.qoder.com.cn/v1/organizations/org_xxx/members/member_001" \
  -H "Authorization: Bearer <api_key>"
Response example:
{
  "id": "member_001",
  "userId": "550e8400-e29b-41d4-a716-446655440000",
  "email": "user@example.com",
  "name": "Alice Zhang",
  "role": "org_member",
  "status": "ENABLED",
  "joinedAt": "2025-01-10T08:00:00Z"
}

Create a member

POST /v1/organizations/{org_id}/members
Create a new user and add the user to the organization. This endpoint creates new accounts only. If the email is already registered, the existing account is not reused and its password is not changed. Request body:
{
  "email": "user@example.com",
  "name": "Alice Zhang",
  "password": "StrongPassword123!",
  "role": "org_member"
}
FieldTypeRequiredDescription
emailstringYesNew user email. Its domain must be verified and enabled for the organization
namestringYesUser and member display name
passwordstringYesInitial password. It must meet the password-strength requirements and is never returned
rolestringNoorg_member or org_admin; defaults to org_member
Request example:
curl -X POST "https://api.qoder.com.cn/v1/organizations/org_xxx/members" \
  -H "Authorization: Bearer <api_key>" \
  -H "Content-Type: application/json" \
  -d '{"email":"user@example.com","name":"Alice Zhang","password":"StrongPassword123!","role":"org_member"}'
Response example:
{
  "member": {
    "id": "member_001",
    "userId": "550e8400-e29b-41d4-a716-446655440000",
    "email": "user@example.com",
    "name": "Alice Zhang",
    "role": "org_member",
    "status": "ENABLED",
    "joinedAt": "2026-05-23T08:00:00Z"
  }
}
The endpoint may return InvalidParameter, InvalidPassword, InvalidRole, EmailDomainRequired, EmailDomainNotSupported, or InsufficientSeats (HTTP 400), or EmailAlreadyExists (HTTP 409).

Member statistics

GET /v1/organizations/{org_id}/members/statistics
Request example:
curl -X GET "https://api.qoder.com.cn/v1/organizations/org_xxx/members/statistics" \
  -H "Authorization: Bearer <api_key>"
Response example:
{
  "totalMembers": 50,
  "billableMembers": 45,
  "adminMembers": 3,
  "purchasedSeats": 60,
  "remainingSeats": 15
}
FieldDescription
totalMembersTotal number of members
billableMembersNumber of billable members
adminMembersNumber of administrators
purchasedSeatsTotal purchased seats
remainingSeatsAvailable seats

Delete a member

DELETE /v1/organizations/{org_id}/members/{member_id}
Request example:
curl -X DELETE "https://api.qoder.com.cn/v1/organizations/org_xxx/members/member_001" \
  -H "Authorization: Bearer <api_key>"
Returns HTTP 204 No Content on success.

Get member quota

GET /v1/organizations/{org_id}/members/{member_id}/quota
Request example:
curl -X GET "https://api.qoder.com.cn/v1/organizations/org_xxx/members/member_001/quota" \
  -H "Authorization: Bearer <api_key>"
Response example:
{
  "planQuota": 1000,
  "resourcePackageQuota": 500,
  "totalQuota": 1500,
  "sharedQuota": 200
}
FieldDescription
planQuotaQuota from the subscription plan
resourcePackageQuotaQuota from resource packages
totalQuotaTotal available quota
sharedQuotaShared pool quota

Batch get member quotas

POST /v1/organizations/{org_id}/members/batchGetQuota
Request body:
{
  "memberIds": ["member_001", "member_002", "member_003"]
}
  • memberIds: Array of member IDs (1–100 items).
Request example:
curl -X POST "https://api.qoder.com.cn/v1/organizations/org_xxx/members/batchGetQuota" \
  -H "Authorization: Bearer <api_key>" \
  -H "Content-Type: application/json" \
  -d '{"memberIds": ["member_001", "member_002"]}'
Response example:
{
  "quotas": [
    {
      "memberId": "member_001",
      "planQuota": 1000,
      "resourcePackageQuota": 500,
      "totalQuota": 1500,
      "sharedQuota": 200
    },
    {
      "memberId": "member_002",
      "planQuota": 1000,
      "resourcePackageQuota": 0,
      "totalQuota": 1000,
      "sharedQuota": 200
    }
  ]
}

Update member Add-On Cap

PUT /v1/organizations/{org_id}/members/{member_id}/addon-cap
Request body:
{
  "addOnCap": 500
}
addOnCap accepts a non-negative integer, null, or omission. null or omission means unlimited; 0 disables the quota. Request example:
curl -X PUT "https://api.qoder.com.cn/v1/organizations/org_xxx/members/member_001/addon-cap" \
  -H "Authorization: Bearer <api_key>" \
  -H "Content-Type: application/json" \
  -d '{"addOnCap": 500}'
Response example:
{
  "memberId": "member_001",
  "email": "user@example.com",
  "addOnCap": 500
}

Batch update Add-On Cap

POST /v1/organizations/{org_id}/batchUpdateAddOnCap
Request body:
{
  "addOnCap": 500,
  "memberIds": ["member_001", "member_002"]
}
Each request accepts 1–100 non-empty member IDs and applies the same cap to every member. addOnCap accepts a non-negative integer, null, or omission; null or omission means unlimited. Request example:
curl -X POST "https://api.qoder.com.cn/v1/organizations/org_xxx/batchUpdateAddOnCap" \
  -H "Authorization: Bearer <api_key>" \
  -H "Content-Type: application/json" \
  -d '{"addOnCap": 500, "memberIds": ["member_001", "member_002"]}'
Response example:
{
  "members": [
    { "memberId": "member_001", "previousAddOnCap": 300 },
    { "memberId": "member_002" }
  ]
}
previousAddOnCap is omitted when the member was previously unlimited. Request validation may return InvalidBatchAddOnCapRequest, EmptyMemberIDs, TooManyMemberIDs, EmptyMemberIDAtIndex, or InvalidAddOnCapFormat.

Update member role

PUT /v1/organizations/{organization_id}/members/{member_id}/role Set an organization member’s role to Organization Admin, Organization Member, Config Admin, or Directory. Available for CN / Global and Teams / Enterprise, using the same IAM role-change capability as the dashboard.

Authentication and permissions

Use the target organization’s API key: Authorization: Bearer <api_key>. The key must belong to the organization in the path. Service account credentials cannot call this endpoint. The member_id must belong to that organization.

Path parameters

ParameterTypeRequiredDescription
organization_idstringYesOrganization ID
member_idstringYesMember ID returned by a member query endpoint; this is not the user ID

Request body

{
  "role": "org_admin"
}
FieldTypeRequiredDescription
rolestringYesorg_admin: Organization Admin; org_member: Organization Member; org_config_admin: Config Admin; org_directory: Directory
role cannot be omitted, null, or an empty string. The deprecated org_free_member and other roles are not supported. Setting a non-billable role again still triggers IAM entitlement reclamation and can retry an incomplete reclamation.

Success response (200 OK)

Returns the updated member details directly, using the same fields as the get member details endpoint.
{
  "id": "member_abc123",
  "userId": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Alice",
  "email": "alice@example.com",
  "role": "org_admin",
  "status": "ENABLED",
  "joinedAt": "2026-09-01T08:00:00Z"
}

Business restrictions

  • At least one administrator (Organization Admin or Config Admin) must remain. Role transitions use the same IAM validation as the dashboard.
  • Removed members cannot change roles; IAM rejects other unavailable member states.
  • Role changes are prohibited while a Teams-to-Enterprise upgrade is pending activation.
  • New assignments of Config Admin or Directory require the DirectoryRole rollout to be enabled for the organization; otherwise, the endpoint returns 403. Both are non-billable roles. Switching to them uses the IAM flow to release seats, remove billing entitlements, and revoke sessions. Switching back to a billable role requires an available seat; failures use the IAM compensation flow. Special-account restrictions match the dashboard.

Error responses

Error codeHTTP statusDescription
BadRequest400Malformed request body, invalid member ID, or member state does not allow changes
InvalidRole400Role is missing or unsupported
OrgMemberAdminCountLacked400Cannot remove the last administrator role
OrganizationPendingUpgrade400Organization is awaiting activation of a Teams-to-Enterprise upgrade
Unauthorized401Missing or invalid credentials
Forbidden403Credentials lack permission, or the new role is not enabled for the organization
UserNotTeamMember404Member does not exist, was removed, or belongs to a different organization
InternalError500Internal service error
Other IAM business errors use the standard OpenAPI error response with requestId, code, and message.
{
  "requestId": "req_abc123",
  "code": "InvalidRole",
  "message": "role must be org_admin, org_member, org_config_admin or org_directory"
}

Request example

curl -X PUT 'https://api.qoder.com.cn/v1/organizations/org_xxx/members/member_abc123/role' \
  -H 'Authorization: Bearer <api_key>' \
  -H 'Content-Type: application/json' \
  -d '{"role":"org_member"}'