Endpoint
Despite being a POST request, this endpoint performs a delete 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
The unique identifier of the team to delete
JWT authentication token with admin privileges
Response
Success (200)
Returns an object containing the status and the deleted team data.HTTP status code (200 for success)
JSON stringified deleted 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 deletion is performed using Prisma’sdelete method as shown in /home/daytona/workspace/source/server/api/teams/delete.ts:42-46:
Important considerations
- Deleting a team may affect related drivers if there are foreign key constraints in the database
- The endpoint returns the deleted team object for confirmation purposes
- This operation is irreversible and should be used with caution