TofuPilotTofuPilot
API Reference (v2)Units

Delete unit attachments

Delete attachments from a unit by their IDs. Removes the files from storage and unlinks them from the unit.

Access

API KeyAccess LevelDescription
UserFullUsers can delete units
StationUnauthorizedStations cannot delete units

Endpoint

DELETE/v2/units/{serial_number}/attachments
AuthorizationBearer <token>

API key for authentication. Use format: Bearer YOUR_API_KEY

In: header

Path Parameters

serial_numberstring

Serial number of the unit. Matched case-insensitively.

Query Parameters

idsarray<string>

Attachment IDs to delete

Response Body

from tofupilot.v2 import TofuPilot

# Initialize the TofuPilot client
client = TofuPilot()

# Execute the operation
result = client.units.delete(
    serial_number="string",
    ids=["550e8400-e29b-41d4-a716-446655440000"]
)

# Handle response
print(result)
{
  "ids": [
    "550e8400-e29b-41d4-a716-446655440000"
  ]
}
{
  "message": "Unauthorized",
  "code": "UNAUTHORIZED",
  "issues": []
}
{
  "message": "Not found",
  "code": "NOT_FOUND",
  "issues": []
}
{
  "message": "Internal server error",
  "code": "INTERNAL_SERVER_ERROR",
  "issues": []
}

How is this guide?