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 Key | Access Level | Description |
|---|---|---|
| User | Full | Users can create batchs |
| Station | Full | Stations can create batchs |
Endpoint
POST
/v2/batchesAuthorizationBearer <token>
API key for authentication. Use format: Bearer YOUR_API_KEY
In: header
numberstring
The batch number identifier
Match
^[a-zA-Z0-9_.:+-]+$Length
1 <= length <= 60Response 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?