v2 Reference (Preview)/Units/Sub-units
Remove sub-unit
Remove a sub-unit from a parent unit. Only removes the parent-child relationship; neither unit is deleted.
DELETE
/v2/units/{serial_number}/children
AuthorizationBearer <token>
API key for authentication. Use format: Bearer YOUR_API_KEY
In: header
Path Parameters
serial_numberstring
Serial number of the parent unit
Length
1 <= length <= 60
Query Parameters
child_serial_numberstring
Serial number of the sub-unit to remove
Length
1 <= length <= 60
Response Body
from tofupilot.v2 import TofuPilot
# Initialize the TofuPilot client
client = TofuPilot()
# Execute the operation
result = client.units.remove_child(
serial_number="UNIT-001",
child_serial_number="SUB-001"
)
# Handle response
print(result)
{
"id": "550e8400-e29b-41d4-a716-446655440000"
}
{
"code": "NOT_FOUND",
"message": "Procedure not found: {id}",
"issues": []
}
{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}
How is this guide?