PATCH /teams/{teamId}
Update a team by ID
Updates a specific team by its ID. The user must have access to the account that owns the team.
Authentication Required
Authorization: Bearer {token}
header string This header is required to access this endpoint
Required Parameters
x-account-id
header string Account ID for the request
teamId
path integer The ID of the team to update
Request Body
{}{ "name": "string", "active": false, "members": [ { "userId": 0 } ]}Try it out
Loading...
Output:
Responses
Description
Team updated successfully
{ "id": 0, "account_id": "string", "accountId": "string", "name": "string", "active": true, "members": [ { "userId": 0, "email": "string", "name": "string" } ], "createdBy": "string", "updatedBy": "string", "createdAt": "string", "updatedAt": "string"}Description
Unauthorized - User not authenticated
Description
Forbidden - User does not have permission to update this team
Description
Team not found
Description
Internal server error
References
#/components/parameters/xAccountIdHeader#/components/schemas/UpdateTeamInput#/components/schemas/TeamMember#/components/schemas/Team
#/components/parameters/xAccountIdHeader
in: headername: x-account-idschema: type: stringdescription: Account ID for the requestrequired: trueexample: "2311"|export type xAccountIdHeader = any; // Schema type not fully supported#/components/schemas/UpdateTeamInput
type: objectdescription: Input for updating a teamproperties: name: type: string description: Name of the team active: type: boolean description: Whether the team is active members: type: array items: type: object properties: userId: type: integer description: ID of the user to add to the team description: Users to add as members of this team|export interface UpdateTeamInput { /** Name of the team */ name?: string; /** Whether the team is active */ active?: boolean; /** Users to add as members of this team */ members?: { userId?: number }[];}#/components/schemas/TeamMember
type: objectdescription: User who is a member of a teamproperties: userId: type: integer description: ID of the user email: type: string description: Email of the user name: type: string description: Name of the userrequired: - userId - email|export interface TeamMember { /** ID of the user */ userId: number; /** Email of the user */ email: string; /** Name of the user */ name?: string;}#/components/schemas/Team
type: objectdescription: Team informationproperties: id: type: integer description: Team ID readOnly: true account_id: type: string description: ID of the account that owns this team accountId: type: string description: ID of the account that owns this team name: type: string description: Team name active: type: boolean default: true description: Whether the team is active members: type: array items: $ref: "#/components/schemas/TeamMember" description: Users who are members of this team createdBy: type: string description: Email of the user who created the team updatedBy: type: string description: Email of the user who last updated the team createdAt: type: string format: date-time description: When the team was created readOnly: true updatedAt: type: string format: date-time description: When the team was last updated readOnly: truerequired: - name|export interface Team { /** Team ID */ id?: number; /** ID of the account that owns this team */ account_id?: string; /** ID of the account that owns this team */ accountId?: string; /** Team name */ name: string; /** Whether the team is active */ active?: boolean; /** Users who are members of this team */ members?: TeamMember[]; /** Email of the user who created the team */ createdBy?: string; /** Email of the user who last updated the team */ updatedBy?: string; /** When the team was created */ createdAt?: Date; /** When the team was last updated */ updatedAt?: Date;}Route Source Code
Check out the source code for this route entrypoint here: /teams/[teamId]/route.ts
Or the swagger.yaml spec this documentation was generated from:
/teams/swagger.yaml