API7 Docs

Update Team Member Role

PATCH /teams/{team_id}/members/{user_id}

PATCH /teams/{team_id}/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

team_id*string

Team ID within the organization.

Formatuuid
user_id*string

User ID of the team member.

Formatuuid

Request Body

application/json

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

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

Updated

{
  "member": {
    "team_id": "810007d0-bec5-486c-b5d1-28fcd8a079ba",
    "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
    "role": "lead"
  }
}
Complete operation details and schema variants

PATCH /teams/{team_id}/members/{user_id}

Update Team Member Role

Change a member's role within the team. A team must keep at least one lead: demoting the last one is refused, so promote another member first.

Parameters

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

Request body

Content type: application/json

  • role (string, required):

Responses

  • 200: Updated

  • member (object, required):

  • member.team_id (string, required):

  • member.user_id (string, required):

  • member.role (string, required):

  • 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 /teams/{team_id}/members/{user_id}, response 400 above.

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

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

  • 409: The change would leave the team without a lead. Response fields (application/json): identical to PATCH /teams/{team_id}/members/{user_id}, response 400 above.

cURL

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