TofuPilotTofuPilot
v2 Reference (Preview)/Parts/Revisions

Update part revision

Update part revision number and/or image. The part number and current revision number are specified in the URL path. Revision numbers are matched case-insensitively (e.g., "REV-A" and "rev-a" are considered the same).

PATCH/v2/parts/{part_number}/revisions/{revision_number}
AuthorizationBearer <token>

API key for authentication. Use format: Bearer YOUR_API_KEY

In: header

Path Parameters

part_numberstring

Part number that the revision belongs to.

Match^[a-zA-Z0-9_.:+-]+$
Length1 <= length <= 60
revision_numberstring

Current revision number to update.

Match^[a-zA-Z0-9_.:+-]+$
Length1 <= length <= 60
number?string

New revision number to set.

Match^[a-zA-Z0-9_.:+-]+$
Length1 <= length <= 60
image_id?string

Upload ID for the revision image, or empty string to remove image

Response Body

from tofupilot.v2 import TofuPilot

# Initialize the TofuPilot client
client = TofuPilot()

# Execute the operation
result = client.parts.revisions.update(
    part_number="PCB-V2.0",
    revision_number="REV-A"
)

# Handle response
print(result)
{
  "id": "550e8400-e29b-41d4-a716-446655440000"
}
{
  "code": "NOT_FOUND",
  "message": "Procedure not found: {id}",
  "issues": []
}
{
  "code": "CONFLICT",
  "message": "A version with this tag already exists for the procedure",
  "issues": []
}
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Internal server error",
  "issues": []
}

How is this guide?