Endpoint
Despite being a POST request, this endpoint performs an update operation. It’s configured this way in the Nitro.js handler.
Authentication
This endpoint requires an admin JWT token. The token must:- Be valid and not expired
- Contain a
userTypefield with value"admin" - Be signed with the application’s secret key
Request
Current team ID to identify which team to update
New team ID (can be the same as oldTeamId if not changing)
Updated full name of the team (max 100 characters)
Updated team nationality (max 50 characters)
Updated URL to the team’s official page (max 255 characters)
Updated URL to the team’s logo image (max 255 characters)
JWT authentication token with admin privileges
Response
Success (200)
Returns an object containing the status and updated team data.HTTP status code (200 for success)
JSON stringified updated team object containing:
Error responses
400 - Bad Request
Returned when no token is provided in the request body
401 - Unauthorized
Returned when:or
- JWT verification fails
- Token has expired
403 - Forbidden
Returned when the authenticated user does not have admin privileges
Example
Response
Implementation notes
The update operation is performed using Prisma’supdate method as shown in /home/daytona/workspace/source/server/api/teams/update.ts:41-52: