TofuPilotTofuPilot
API Reference (v2)Batches

Create batch

Create a new batch without any units attached. Batch numbers are matched case-insensitively (e.g., "BATCH-001" and "batch-001" are considered the same).

Access

API KeyAccess LevelDescription
UserFullUsers can create batchs
StationFullStations can create batchs

Endpoint

POST/v2/batches
AuthorizationBearer <token>

API key for authentication. Use format: Bearer YOUR_API_KEY

In: header

numberstring

The batch number identifier

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

Response Body

from tofupilot.v2 import TofuPilot

# Initialize the TofuPilot client
client = TofuPilot()

# Execute the operation
result = client.batches.create(
    number="string"
)

# Handle response
print(result)
{
  "id": "string"
}
{
  "message": "Bad request",
  "code": "BAD_REQUEST",
  "issues": []
}
{
  "message": "Unauthorized",
  "code": "UNAUTHORIZED",
  "issues": []
}
{
  "message": "Conflict",
  "code": "CONFLICT",
  "issues": []
}
{
  "message": "Internal server error",
  "code": "INTERNAL_SERVER_ERROR",
  "issues": []
}

How is this guide?