TofuPilotTofuPilot
API Reference (v2)Parts

List and filter parts

Retrieve a paginated list of parts and components in your organization. Filter and search by part name, number, or revision number for inventory management.

Access

API KeyAccess LevelDescription
UserFullUsers can read parts
StationFullStations can read parts

Endpoint

GET/v2/parts
AuthorizationBearer <token>

API key for authentication. Use format: Bearer YOUR_API_KEY

In: header

Query Parameters

limit?integer

Maximum number of parts to return in a single page.

Default50
Range1 <= value <= 100
cursor?integer

Offset position for pagination. Use the next_cursor from the previous response to get the next page.

Range-9007199254740991 <= value <= 9007199254740991
search_query?string

Search text to filter parts by name, part number, or revision number.

Lengthlength <= 100
procedure_ids?array<string>

Filter parts by procedures (parts that have runs with these procedures).

sort_by?string

Field to sort results by.

Default"created_at"
Value in"name" | "number" | "created_at"
sort_order?string

Sort order direction.

Default"desc"
Value in"asc" | "desc"

Response Body

from tofupilot.v2 import TofuPilot

# Initialize the TofuPilot client
client = TofuPilot()

# Execute the operation
result = client.parts.list(
    limit=50,
    cursor=50,
    search_query="PCB",
    procedure_ids=["497f6eca-6276-4993-bfeb-53cbbbba6f08"],
    sort_by="created_at",
    sort_order="desc"
)

# Handle response
print(result)
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "number": "PCB-V2.0",
      "name": "Main PCB Board",
      "created_at": "2019-08-24T14:15:22Z",
      "revisions": [
        {
          "id": "550e8400-e29b-41d4-a716-446655440001",
          "number": "REV-A"
        }
      ]
    }
  ],
  "meta": {
    "has_more": true,
    "next_cursor": 50
  }
}
{
  "message": "Unauthorized",
  "code": "UNAUTHORIZED",
  "issues": []
}
{
  "message": "Internal server error",
  "code": "INTERNAL_SERVER_ERROR",
  "issues": []
}

How is this guide?