# Create or Edit a Team

put ` https://app.mk.io/api/v1/organization/teams/:team_name`

Create a new team with a unique name, or Edit an existing team.

RBAC Capability Required: `core.team.create`

## Authentication

Authorization Bearer

Bearer authentication of the form `Bearer <token>`, where token is your
auth token.

## Path parameters

**team_name**  
**string**  
**Required**

## Request

This endpoint expects an object.

**spec**  
**object**  [TeamSpecSchemaCreate](https://docs.mediakind.com/api-reference/management-api/schemas/teamspecschemacreate)  
**Required**

Team specification.

**description**  
**string**  
**Optional**  
0-256 characters  
A description of the team.

**members**  
**map from strings to object** [TeamMemberSchemaCreate](https://docs.mediakind.com/api-reference/management-api/schemas/teammemberschemacreate)  
**Optional**  
The list of members.

**[any key]**  
**object**

**isTeamAdmin**  
**boolean**  
**Required**  
Does this user have the ability to edit this team

**scopes**  
**map from strings to object** [TeamScopeSchema](https://docs.mediakind.com/api-reference/management-api/schemas/teamscopeschema)  
**Optional**  
The set of scopes this team has access to, and the roles on each.

**[any key]**  
**object**

**roles**  
**list of strings**  
**Required**  
The names of the roles.

## Response

**200 Updated**

**kind**  
**string**  
**Optional**  
The kind of record.

**metadata**  
**object** [TeamMetadataSchema](https://docs.mediakind.com/api-reference/management-api/schemas/teammetadataschema)  
**Required**  
Team metadata.

**id**  
**string**  
**Required**  
format: uuid  
The ID of the resource

**name**  
**string**  
**Optional**  
The name of the resource

**spec**  
**object** [TeamSpecSchemaRead](https://docs.mediakind.com/api-reference/management-api/schemas/teamspecschemaread)  
**Required**  
Team specification.

**description**  
**string**  
**Optional**  
0-256 characters  
A description of the team.

**members**  
**map from strings to object** [TeamMemberSchemaRead](https://docs.mediakind.com/api-reference/management-api/schemas/teammemberschemaread)  
**Optional**  
The list of members.

**[any key]**  
**object**

**email**  
**string**  
**Required**  
The email address of the team member

**isTeamAdmin**  
**boolean**  
**Required**  
Does this user have the ability to edit this team

**name**  
**string**  
**Required**  
The name of the team member

**[any key]**  
**object**

**roles**  
**list of strings**  
**Required**
The names of the roles.

**201 Created**

**kind**  
**string**  
**Optional**  
The kind of record.

**metadata**  
**object** [TeamMetadataSchema](https://docs.mediakind.com/api-reference/management-api/schemas/teammetadataschema)  
**Required**  
Team metadata.

**id**  
**string**  
**Required**  
format: uuid  
The ID of the resource

**name**  
**string**  
**Optional**  
The name of the resource

**spec**  
**object** [TeamSpecSchemaRead](https://docs.mediakind.com/api-reference/management-api/schemas/teamspecschemaread)  
**Required**  
Team specification.

**description**  
**string**  
**Optional**  
0-256 characters  
A description of the team.

**[any key]**  
**object**

**email**  
**string**  
**Required**  
The email address of the team member

**isTeamAdmin**  
**boolean**  
**Required**  
Does this user have the ability to edit this team

**name**  
**string**  
**Required**  
The name of the team member

**[any key]**  
**object**

**roles**  
**list of strings**  
**Required**
The names of the roles.

## Errors

**400 Bad Request**

**error**  
**object** [ErrorDetail](https://docs.mediakind.com/api-reference/management-api/schemas/errordetail)  
**Required**  
Pertinent information about the error

**code**  
**string**  
**Required**  
The error code.

**detail**  
**string**  
**Required**  
The error message.

**extraDetail**  
**map from strings to any**  
**Optional**  
Extra information regarding this error.

**[any key]**  
**any**

**ref**  
**string**  
**Required**  
A reference to the request that caused the error.

**status**  
**integer**  
**Required**  
The HTTP status code

**401 Unauthorized**

**code**  
**string**  
**Required**  
The error code.

**detail**  
**string**  
**Required**  
The error message.

**extraDetail**  
**map from strings to any**  
**Optional**  
Extra information regarding this error.

**[any key]**  
**any**

**ref**  
**string**  
**Required**  
A reference to the request that caused the error.

**status**  
**integer**  
**Required**  
The HTTP status code

**403 Forbidden**

**code**  
**string**  
**Required**  
The error code.

**detail**  
**string**  
**Required**  
The error message.

**extraDetail**  
**map from strings to any**  
**Optional**  
Extra information regarding this error.

**[any key]**  
**any**

**ref**  
**string**  
**Required**  
A reference to the request that caused the error.

**status**  
**integer**  
**Required**  
The HTTP status code

**404 Not Found**

**code**  
**string**  
**Required**  
The error code.

**detail**  
**string**  
**Required**  
The error message.

**extraDetail**  
**map from strings to any**  
**Optional**  
Extra information regarding this error.

**[any key]**  
**any**

**ref**  
**string**  
**Required**  
A reference to the request that caused the error.

**status**  
**integer**  
**Required**  
The HTTP status code

**429 Too Many Requests**

**code**  
**string**  
**Required**  
The error code.

**detail**  
**string**  
**Required**  
The error message.

**extraDetail**  
**map from strings to any**  
**Optional**  
Extra information regarding this error.

**[any key]**  
**any**

**ref**  
**string**  
**Required**  
A reference to the request that caused the error.

**status**  
**integer**  
**Required**  
The HTTP status code

**500 Internal Server Error**

**code**  
**string**  
**Required**  
The error code.

**detail**  
**string**  
**Required**  
The error message.

**extraDetail**  
**map from strings to any**  
**Optional**  
Extra information regarding this error.

**[any key]**  
**any**

**ref**  
**string**  
**Required**  
A reference to the request that caused the error.

**status**  
**integer**  
**Required**  
The HTTP status code
