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 Key | Access Level | Description |
---|---|---|
User | Full | Users can delete units they have permission to access |
Station | Unauthorized | Stations 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?
Update unit PATCH
Update unit properties including serial number, part number, revision, batch. The current serial number is specified in the URL path. Serial numbers are matched case-insensitively (e.g., "UNIT-001" and "unit-001" are considered the same).
Add sub-unit PUT
Add a sub-unit to a parent unit.