API7 Docs

Update Member Organization Role

PATCH /members/{user_id}

PATCH /members/{user_id}

Interactive request editor loads with JavaScript.

Authorization

BearerAdminToken
AuthorizationBearer <token>

Organization-scoped admin token. Read operations require a valid token, and write operations require a token with write permission.

In: header

Path Parameters

user_id*string

User ID of the organization member.

Formatuuid

Request Body

application/json

Organization role assignment for one member.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "$AISIX_CP/members/$USER_ID" \  -H "Authorization: Bearer $AISIX_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "role": "string"  }'

Updated

{
  "member": {
    "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
    "role": "string"
  }
}
Complete operation details and schema variants

PATCH /members/{user_id}

Update Member Organization Role

Replace a member's organization-wide role. Only an organization owner can assign roles. Assigning owner clears the member's environment role bindings because owners already have full access. The last owner cannot be demoted.

Parameters

  • user_id (path, string, required): User ID of the organization member.

Request body

Content type: application/json

  • role (string, required): owner, admin, member, or an existing custom role.

Responses

  • 200: Updated

  • member (object, required): Member role fields returned after an organization-role update.

  • member.user_id (string, required): Updated member's user ID.

  • member.role (string, required): Assigned built-in or custom organization role.

  • 400: Request body or parameters failed validation.

  • error (object, required): Error details.

  • error.code (string, required): Machine-readable identifier. Examples: UNAUTHENTICATED, INVALID_REQUEST, MASTER_KEY_UNSET, INTERNAL.

  • error.message (string, required): Human-readable explanation; safe to surface to operators.

  • 401: Missing or invalid bearer. Response fields (application/json): identical to PATCH /members/{user_id}, response 400 above.

  • 403: Authenticated request is not permitted. Response fields (application/json): identical to PATCH /members/{user_id}, response 400 above.

  • 404: Resource not found. Response fields (application/json): identical to PATCH /members/{user_id}, response 400 above.

  • 409: The update would demote the last owner. Response fields (application/json): identical to PATCH /members/{user_id}, response 400 above.

cURL

curl -X PATCH '$AISIX_CP/members/{user_id}' -H 'Authorization: Bearer $AISIX_TOKEN'