TofuPilotTofuPilot
v2 Reference (Preview)/Units

Delete units

Permanently delete units by serial number. This action will remove all nested elements and relationships associated with the units.

API v2 Preview

The TofuPilot API v2.0 is currently in public preview and is subject to change as we stabilize until release (planned for Aug 2025).

Access

API KeyAccess LevelDescription
UserFullUsers can delete units they have permission to access
StationUnauthorizedStations cannot delete units

Endpoint

DELETE/v2/units
AuthorizationBearer <token>

API key for authentication. Use format: Bearer YOUR_API_KEY

In: header

Query Parameters

serial_numbersarray<string>

Array of unit serial numbers to delete.

Response Body

from tofupilot.v2 import TofuPilot

# Initialize the TofuPilot client
client = TofuPilot()

# Execute the operation
result = client.units.delete(
    serial_numbers=["UNIT-001", "UNIT-002"]
)

# Handle response
print(result)
{
  "ids": [
    "550e8400-e29b-41d4-a716-446655440000",
    "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
  ]
}
{
  "code": "NOT_FOUND",
  "message": "Procedure not found: {id}",
  "issues": []
}
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Internal server error",
  "issues": []
}

How is this guide?