Add Team Member
POST /teams/{team_id}/members
POST /teams/{team_id}/membersInteractive request editor loads with JavaScript.
Authorization
BearerAdminToken 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 within the organization.
uuidRequest Body
application/json
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "$AISIX_CP/teams/$TEAM_ID/members" \ -H "Authorization: Bearer $AISIX_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" }'Created
{
"member": {
"team_id": "810007d0-bec5-486c-b5d1-28fcd8a079ba",
"user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
"email": "string",
"display_name": "string",
"role": "lead",
"added_by": "6f5851d8-8a63-4597-95ec-4f964b8e7696",
"added_at": "2019-08-24T14:15:22Z"
}
}The request failed validation, or the user is not a member of this organization (`USER_NOT_IN_ORG`).
{
"error": {
"code": "USER_NOT_IN_ORG",
"message": "user must be a member of this organization before joining a team"
}
}Missing or invalid bearer.
{
"error": {
"code": "UNAUTHENTICATED",
"message": "no org context"
}
}Authenticated request is not permitted.
{
"error": {
"code": "CUSTOM_KEY_DISABLED",
"message": "custom API key values are disabled for this organization"
}
}Resource not found.
{
"error": {
"code": "NOT_FOUND",
"message": "provider key not found"
}
}Complete operation details and schema variants
POST /teams/{team_id}/members
Add Team Member
Put an existing organization member on the team. The user must
already belong to the organization — this endpoint does not
invite anyone. role defaults to member.
Parameters
team_id(path, string, required): Team ID within the organization.
Request body
Content type: application/json
-
user_id(string, required): Organization member to add, given as that member'suser_idfromGET /members. Must already belong to the organization. -
role(string, optional):
Responses
-
201: Created -
member(object, required): -
member.team_id(string, required): -
member.user_id(string, required): Organization member on the team. -
member.email(string, required): Member's organization email, resolved for convenience. -
member.display_name(string, required): Member's display name, resolved for convenience. -
member.role(string, required): Role within this team. A team must keep at least onelead. -
member.added_by(string, required): -
member.added_at(string, required): -
400: The request failed validation, or the user is not a member of this organization (USER_NOT_IN_ORG). -
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 toPOST /teams/{team_id}/members, response 400 above. -
403: Authenticated request is not permitted. Response fields (application/json): identical toPOST /teams/{team_id}/members, response 400 above. -
404: Resource not found. Response fields (application/json): identical toPOST /teams/{team_id}/members, response 400 above.
cURL
curl -X POST '$AISIX_CP/teams/{team_id}/members' -H 'Authorization: Bearer $AISIX_TOKEN'