Skip to main content
DELETE
https://api-dev.weir.ai/
/
org
/
team
/
:teamId
curl -X DELETE 'https://api.weir.ai/org/team/team_123456789' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'x-source: console'
{
  "message": "Team deleted successfully",
  "status": "success"
}

Delete Team

Permanently delete a team from your organization. This action cannot be undone.
Caution: Deleting a team is permanent and cannot be undone. All team data and member associations will be removed.
curl -X DELETE 'https://api.weir.ai/org/team/team_123456789' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'x-source: console'
{
  "message": "Team deleted successfully",
  "status": "success"
}

Authentication

Requires Console API authentication with bearer token and x-source: console header.

Path Parameters

teamId
string
required
Unique identifier of the team to delete.

Response Fields

message
string
required
Human-readable message confirming the deletion.
status
string
required
Operation status. Always “success” for successful deletion.

Error Responses

{
  "error": {
    "code": "TEAM_NOT_FOUND",
    "message": "Team not found",
    "details": "The specified team does not exist or you do not have access"
  },
  "status": "error"
}
{
  "error": {
    "code": "INSUFFICIENT_PERMISSIONS",
    "message": "Insufficient permissions",
    "details": "You do not have permission to delete this team"
  },
  "status": "error"
}

Usage Examples

const deleteTeam = async (teamId, accessToken) => {
  try {
    const response = await fetch(`https://api.weir.ai/org/team/${teamId}`, {
      method: 'DELETE',
      headers: {
        'Authorization': `Bearer ${accessToken}`,
        'x-source': 'console'
      }
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    return await response.json();
  } catch (error) {
    console.error('Delete team error:', error);
    throw error;
  }
};

// Usage with confirmation
if (confirm('Are you sure you want to delete this team?')) {
  await deleteTeam('team_123456789', 'your_access_token');
  console.log('Team deleted successfully');
}

Best Practices

Confirm Action

Always implement confirmation dialogs before deleting teams.

Check Dependencies

Verify that no critical resources depend on this team.

Notify Members

Notify team members before deletion if possible.

Archive Option

Consider implementing an archive feature instead of permanent deletion.
Pro Tip: Consider implementing a soft delete mechanism where teams are marked as inactive rather than permanently deleted, allowing for potential recovery.