Create Team
POST /teams
POST /teamsInteractive 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
Request Body
application/json
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "$AISIX_CP/teams" \ -H "Authorization: Bearer $AISIX_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "display_name": "string" }'Created
{
"team": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
"display_name": "string",
"description": "string",
"created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"member_count": 0
}
}Request body or parameters failed validation.
{
"error": {
"code": "string",
"message": "string"
}
}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"
}
}A team with this display name already exists.
{
"error": {
"code": "DUPLICATE_NAME",
"message": "a team with this display_name already exists in this org"
}
}Complete operation details and schema variants
POST /teams
Create Team
Create a team. Teams group organization members so a limit,
budget or MCP entitlement can be written once and apply to
everyone on the team. display_name must be unique within the
organization.
Parameters
Request body
Content type: application/json
display_name(string, required): Team name, unique within the organization.description(string, optional): Free-text description.
Responses
-
201: Created -
team(object, required): -
team.id(string, required): Team ID. -
team.org_id(string, required): Organization that owns the team. -
team.display_name(string, required): Team name, unique within the organization. -
team.description(string, required): Free-text description. Empty when unset. -
team.created_by(string, required): User who created the team. -
team.created_at(string, required): -
team.updated_at(string, required): -
team.member_count(integer, required): Members currently on the team. -
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 toPOST /teams, response 400 above. -
403: Authenticated request is not permitted. Response fields (application/json): identical toPOST /teams, response 400 above. -
409: A team with this display name already exists. Response fields (application/json): identical toPOST /teams, response 400 above.
cURL
curl -X POST '$AISIX_CP/teams' -H 'Authorization: Bearer $AISIX_TOKEN'