API Reference
Build custom workflows and integrations with our REST API. Manage cases, containers, packs, and entities programmatically or with AI.
Introduction
Base URL
https://steady-beagle-345.convex.site/api/v1- All dimensions are in meters, weights in kilograms
- Rate limited to 200 requests/minute with 300 burst capacity
orgIdis automatically inferred from the API key
Authentication
All requests require a Bearer token in the Authorization header. Generate an API key from Settings → API Keys in the Truck Packer app. Keys start with tp_.
Header format
AuthorizationstringrequiredBearer token in the format: Bearer tp_your-api-key
curl https://steady-beagle-345.convex.site/api/v1/cases \
-H "Authorization: Bearer tp_your-api-key"Use with AI
Give any LLM or AI agent full knowledge of the Truck Packer REST API. Copy the skill file below into your agent's context, or download the raw markdown.
Works with:
- Claude — paste into a Project's custom instructions or as a tool description
- ChatGPT / GPTs — add as knowledge or instructions
- Custom agents — include in your agent's system prompt or as a retrieval document
# Truck Packer REST API – AI Agent Skill
You are an AI agent with access to the Truck Packer REST API. Use this reference to make API calls on behalf of the user.
## Authentication
All requests require a Bearer token:
```
Authorization: Bearer tp_<api-key>
```
Generate keys from **Settings → API Keys** in the Truck Packer app.
## Base URL
```
https://steady-beagle-345.convex.site/api/v1
```
## Conventions
- Dimensions: **meters**
- Weights: **kilograms**
- Rate limit: 200 req/min, 300 burst
- \`orgId\` is inferred from the API key — never include it in request bodies
---
## Cases
Cases are box types that can be loaded into containers.
### List Cases
```
GET /api/v1/cases
```
### Get Case by ID
```
GET /api/v1/cases/:id
```
### Create Case
```
POST /api/v1/cases
Content-Type: application/json
{
"name": "string (required)",
"dx": "number (required) — length in meters",
"dy": "number (required) — width in meters",
"dz": "number (required) — height in meters",
"canRotate3d": "boolean (required)",
"categoryId": "string (required)",
"description": "string (optional)",
"manufacturer": "string (optional)",
"weight": "number (optional) — kilograms"
}
```
### Update Case
```
PUT /api/v1/cases/:id
Content-Type: application/json
{
"name": "string",
"description": "string",
"manufacturer": "string",
"weight": "number",
"dx": "number",
"dy": "number",
"dz": "number",
"canRotate3d": "boolean",
"categoryId": "string"
}
```
All fields optional — include only what you want to change.
### Delete Case
```
DELETE /api/v1/cases/:id
```
---
## Case Categories
Categories group cases by type with a color for visual identification.
### List Case Categories
```
GET /api/v1/case-categories
```
### Create Case Category
```
POST /api/v1/case-categories
Content-Type: application/json
{
"name": "string (required)",
"colorHex": "string (required) — e.g. '#FF4444'"
}
```
### Update Case Category
```
PUT /api/v1/case-categories/:id
Content-Type: application/json
{
"name": "string",
"colorHex": "string"
}
```
### Delete Case Category
```
DELETE /api/v1/case-categories/:id
```
---
## Containers
Containers are the trucks, trailers, or shipping containers that cases are loaded into.
### List Containers
```
GET /api/v1/containers
```
### Get Container by ID
```
GET /api/v1/containers/:id
```
### Create Container
```
POST /api/v1/containers
Content-Type: application/json
{
"name": "string (required)",
"type": "string (required) — one of: dry_container, boxcar, flatbed_trailer, step_deck_trailer, dry_van_trailer, reefer_van_trailer, box_truck, uld",
"dx": "number (required) — length in meters",
"dy": "number (required) — width in meters",
"dz": "number (required) — height in meters",
"description": "string (optional)",
"code": "string (optional)",
"payloadCapacity": "number (optional) — kilograms"
}
```
### Update Container
```
PUT /api/v1/containers/:id
Content-Type: application/json
{
"name": "string",
"description": "string",
"code": "string",
"type": "string",
"dx": "number",
"dy": "number",
"dz": "number",
"payloadCapacity": "number"
}
```
### Delete Container
```
DELETE /api/v1/containers/:id
```
---
## Packs
Packs are loading plans — workspaces where cases are arranged inside containers.
### List Packs
```
GET /api/v1/packs
```
### Get Pack by ID
```
GET /api/v1/packs/:id
```
### Get Pack Entities
```
GET /api/v1/packs/:id/entities
```
Returns all entities (cases, containers, groups) within a pack.
### Create Pack
```
POST /api/v1/packs
Content-Type: application/json
{
"name": "string (optional)",
"folderId": "string (optional)"
}
```
### Delete Pack
```
DELETE /api/v1/packs/:id
```
Permanently deletes the pack and all its entities, export views, and thumbnails.
---
## Entities
Entities are scene graph nodes within a pack — cases, containers, and groups positioned in 3D space.
### Get Entities by Pack ID
```
GET /api/v1/entities?packId=PACK_ID
```
The \`packId\` query parameter is required.
### Batch Create Entities
```
POST /api/v1/entities:batchCreate
Content-Type: application/json
{
"entities": [
{
"name": "string (required)",
"type": "string (required) — case | container | group",
"packId": "string (required)",
"visible": "boolean (required)",
"childrenIds": "string[] (required) — empty array for leaf nodes",
"position": "{ x, y, z } (required) — meters",
"quaternion": "{ x, y, z, w } (required) — use {0,0,0,1} for no rotation",
"size": "{ x, y, z } (required) — meters",
"caseData": "{ weight?, manufacturer?, canRotate3d, categoryId } (required when type=case)",
"containerData": "{ type, payloadCapacity? } (required when type=container)",
"groupData": "{ colorHex } (required when type=group)"
}
]
}
```
> **Important:** You must include the matching type-specific data object for each entity. For example, an entity with \`type: "case"\` requires \`caseData\`. Entities missing their type-specific data will be silently dropped from the batch.
### Batch Update Entities
```
POST /api/v1/entities:batchUpdate
Content-Type: application/json
{
"packId": "string (required)",
"entities": [
{
"id": "string (required)",
"name": "string",
"description": "string",
"visible": "boolean",
"position": "{ x, y, z }",
"quaternion": "{ x, y, z, w }",
"size": "{ x, y, z }",
"caseData": "object",
"containerData": "object",
"groupData": "object"
}
]
}
```
Only include fields you want to change.
### Batch Delete Entities
```
POST /api/v1/entities:batchDelete
Content-Type: application/json
{
"packId": "string (required)",
"ids": ["ENTITY_ID_1", "ENTITY_ID_2"]
}
```
Children are deleted recursively.
---
## Common Workflows
### Import cases from an external system
1. \`POST /api/v1/case-categories\` — create categories first
2. \`POST /api/v1/cases\` — create cases with the category IDs
### Build a load plan programmatically
1. \`POST /api/v1/packs\` — create a pack
2. \`POST /api/v1/entities:batchCreate\` — batch create containers and cases with positions
### Sync inventory
1. \`GET /api/v1/cases\` — fetch current cases
2. \`PUT /api/v1/cases/:id\` — update changed cases
3. \`POST /api/v1/cases\` — create new cases
4. \`DELETE /api/v1/cases/:id\` — remove deleted cases
---
## Error Responses
All errors return JSON:
```json
{
"success": false,
"error": "Error message describing what went wrong"
}
```
| Status | Meaning |
|--------|---------|
| 401 | Missing or invalid API key |
| 404 | Resource not found |
| 422 | Validation error (check required fields) |
| 429 | Rate limit exceeded |
| 500 | Server error |Cases
Cases represent box types that can be loaded into containers.
List Cases
/api/v1/casesReturns all cases belonging to the authenticated organization.
curl https://steady-beagle-345.convex.site/api/v1/cases \
-H "Authorization: Bearer tp_your-api-key"Get Case by ID
/api/v1/cases/:idReturns a single case by its ID.
Parameters
idstringrequiredPathThe case ID.
curl https://steady-beagle-345.convex.site/api/v1/cases/CASE_ID \
-H "Authorization: Bearer tp_your-api-key"Create Case
/api/v1/casesCreate a new case (box type). The orgId is inferred from the API key.
Parameters
namestringrequiredBodyCase name.
dxnumberrequiredBodyLength in meters.
dynumberrequiredBodyWidth in meters.
dznumberrequiredBodyHeight in meters.
canRotate3dbooleanrequiredBodyWhether the case can rotate freely on any axis.
categoryIdstringrequiredBodyID of the case category.
descriptionstringBodyOptional description.
manufacturerstringBodyManufacturer name.
weightnumberBodyWeight in kilograms.
curl -X POST https://steady-beagle-345.convex.site/api/v1/cases \
-H "Authorization: Bearer tp_your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "Widget Box",
"description": "Standard shipping box",
"manufacturer": "Acme Corp",
"weight": 12.5,
"dx": 0.5,
"dy": 0.3,
"dz": 0.4,
"canRotate3d": true,
"categoryId": "CATEGORY_ID"
}'Update Case
/api/v1/cases/:idUpdate an existing case. Pass the case ID in the URL path.
Parameters
idstringrequiredPathThe case ID.
namestringBodyCase name.
descriptionstringBodyDescription.
manufacturerstringBodyManufacturer name.
weightnumberBodyWeight in kilograms.
dxnumberBodyLength in meters.
dynumberBodyWidth in meters.
dznumberBodyHeight in meters.
canRotate3dbooleanBodyWhether AutoPack can rotate freely.
categoryIdstringBodyCase category ID.
curl -X PUT https://steady-beagle-345.convex.site/api/v1/cases/CASE_ID \
-H "Authorization: Bearer tp_your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Widget Box",
"dx": 0.6,
"dy": 0.35,
"dz": 0.45,
"canRotate3d": false,
"categoryId": "CATEGORY_ID"
}'Delete Case
/api/v1/cases/:idPermanently delete a case by its ID.
Parameters
idstringrequiredPathThe case ID.
curl -X DELETE https://steady-beagle-345.convex.site/api/v1/cases/CASE_ID \
-H "Authorization: Bearer tp_your-api-key"Case Categories
Case categories group cases by type (e.g., Fragile, Heavy, Standard) with a color for visual identification.
List Case Categories
/api/v1/case-categoriesReturns all case categories for the authenticated organization.
curl https://steady-beagle-345.convex.site/api/v1/case-categories \
-H "Authorization: Bearer tp_your-api-key"Create Case Category
/api/v1/case-categoriesCreate a new case category.
Parameters
namestringrequiredBodyCategory name.
colorHexstringrequiredBodyHex color code (e.g. "#FF4444").
curl -X POST https://steady-beagle-345.convex.site/api/v1/case-categories \
-H "Authorization: Bearer tp_your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "Fragile",
"colorHex": "#FF4444"
}'Update Case Category
/api/v1/case-categories/:idUpdate an existing case category.
Parameters
idstringrequiredPathCategory ID.
namestringBodyCategory name.
colorHexstringBodyHex color code.
curl -X PUT https://steady-beagle-345.convex.site/api/v1/case-categories/CATEGORY_ID \
-H "Authorization: Bearer tp_your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "Very Fragile",
"colorHex": "#FF0000"
}'Delete Case Category
/api/v1/case-categories/:idDelete a case category by its ID.
Parameters
idstringrequiredPathCategory ID.
curl -X DELETE https://steady-beagle-345.convex.site/api/v1/case-categories/CATEGORY_ID \
-H "Authorization: Bearer tp_your-api-key"Containers
Containers represent the trucks, trailers, or shipping containers that cases are loaded into.
List Containers
/api/v1/containersReturns all containers for the authenticated organization.
curl https://steady-beagle-345.convex.site/api/v1/containers \
-H "Authorization: Bearer tp_your-api-key"Get Container by ID
/api/v1/containers/:idReturns a single container by its ID.
Parameters
idstringrequiredPathContainer ID.
curl https://steady-beagle-345.convex.site/api/v1/containers/CONTAINER_ID \
-H "Authorization: Bearer tp_your-api-key"Create Container
/api/v1/containersCreate a new container (truck/trailer/shipping container).
Parameters
namestringrequiredBodyContainer name.
typestringrequiredBodyOne of: dry_container, boxcar, flatbed_trailer, step_deck_trailer, dry_van_trailer, reefer_van_trailer, box_truck, uld.
dxnumberrequiredBodyLength in meters.
dynumberrequiredBodyWidth in meters.
dznumberrequiredBodyHeight in meters.
descriptionstringBodyOptional description.
codestringBodyOptional code identifier.
payloadCapacitynumberBodyMax payload in kilograms.
curl -X POST https://steady-beagle-345.convex.site/api/v1/containers \
-H "Authorization: Bearer tp_your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "53ft Dry Van",
"description": "Standard 53-foot dry van trailer",
"code": "DV-53",
"type": "dry_van_trailer",
"dx": 16.15,
"dy": 2.49,
"dz": 2.59,
"payloadCapacity": 20000
}'Update Container
/api/v1/containers/:idUpdate an existing container.
Parameters
idstringrequiredPathContainer ID.
namestringBodyContainer name.
descriptionstringBodyDescription.
codestringBodyCode identifier.
typestringBodyContainer type.
dxnumberBodyLength in meters.
dynumberBodyWidth in meters.
dznumberBodyHeight in meters.
payloadCapacitynumberBodyMax payload in kg.
curl -X PUT https://steady-beagle-345.convex.site/api/v1/containers/CONTAINER_ID \
-H "Authorization: Bearer tp_your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "53ft Reefer",
"type": "reefer_van_trailer",
"dx": 16.15,
"dy": 2.49,
"dz": 2.59,
"payloadCapacity": 18000
}'Delete Container
/api/v1/containers/:idPermanently delete a container by its ID.
Parameters
idstringrequiredPathContainer ID.
curl -X DELETE https://steady-beagle-345.convex.site/api/v1/containers/CONTAINER_ID \
-H "Authorization: Bearer tp_your-api-key"Packs
Packs represent loading plans — a workspace where cases are arranged inside containers.
List Packs
/api/v1/packsReturns all packs for the authenticated organization.
curl https://steady-beagle-345.convex.site/api/v1/packs \
-H "Authorization: Bearer tp_your-api-key"Get Pack by ID
/api/v1/packs/:idReturns a single pack by its ID.
Parameters
idstringrequiredPathThe pack ID.
curl https://steady-beagle-345.convex.site/api/v1/packs/PACK_ID \
-H "Authorization: Bearer tp_your-api-key"Get Pack Entities
/api/v1/packs/:id/entitiesReturns all entities (cases, containers, groups) within a specific pack. Excludes soft-deleted entities.
Parameters
idstringrequiredPathThe pack ID.
curl https://steady-beagle-345.convex.site/api/v1/packs/PACK_ID/entities \
-H "Authorization: Bearer tp_your-api-key"Create Pack
/api/v1/packsCreate a new pack (loading plan).
Parameters
namestringBodyPack name.
folderIdstringBodyOptional folder ID to place the pack in.
curl -X POST https://steady-beagle-345.convex.site/api/v1/packs \
-H "Authorization: Bearer tp_your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "Warehouse Shipment #42"
}'Delete Pack
/api/v1/packs/:idPermanently delete a pack and all its entities, export views, and preview thumbnails.
Parameters
idstringrequiredPathThe pack ID.
curl -X DELETE https://steady-beagle-345.convex.site/api/v1/packs/PACK_ID \
-H "Authorization: Bearer tp_your-api-key"Entities
Entities are the scene graph nodes within a pack — cases, containers, and groups positioned in 3D space.
Get Entities by Pack ID
/api/v1/entities?packId=:packIdReturns all entities for a specific pack. The packId query parameter is required.
Parameters
packIdstringrequiredQueryThe pack ID to fetch entities for.
curl "https://steady-beagle-345.convex.site/api/v1/entities?packId=PACK_ID" \
-H "Authorization: Bearer tp_your-api-key"Batch Create Entities
/api/v1/entities:batchCreateBatch create entities within a pack.
Parameters
entitiesarrayrequiredBodyArray of entity objects to create.
entities[].namestringrequiredBodyEntity name.
entities[].typestringrequiredBodyOne of: case, container, group.
entities[].packIdstringrequiredBodyPack ID this entity belongs to.
entities[].visiblebooleanrequiredBodyWhether the entity is visible.
entities[].childrenIdsstring[]requiredBodyArray of child entity IDs (empty for leaf nodes).
entities[].position{ x, y, z }requiredBodyPosition in meters.
entities[].quaternion{ x, y, z, w }requiredBodyRotation quaternion. Use {0,0,0,1} for no rotation.
entities[].size{ x, y, z }requiredBodyDimensions in meters.
entities[].caseDataobjectBodyRequired for case type: { weight?, manufacturer?, canRotate3d, categoryId }.
entities[].containerDataobjectBodyRequired for container type: { type, payloadCapacity? }.
entities[].groupDataobjectBodyFor group type: { colorHex }.
curl -X POST https://steady-beagle-345.convex.site/api/v1/entities:batchCreate \
-H "Authorization: Bearer tp_your-api-key" \
-H "Content-Type: application/json" \
-d '{
"entities": [
{
"name": "Widget Box #1",
"type": "case",
"packId": "PACK_ID",
"visible": true,
"childrenIds": [],
"position": { "x": 0, "y": 0, "z": 0 },
"quaternion": { "x": 0, "y": 0, "z": 0, "w": 1 },
"size": { "x": 0.5, "y": 0.3, "z": 0.4 },
"caseData": {
"weight": 12.5,
"canRotate3d": true,
"categoryId": "CATEGORY_ID"
}
}
]
}'Batch Update Entities
/api/v1/entities:batchUpdateBatch update entities within a pack. Only include the fields you want to change.
Parameters
packIdstringrequiredBodyThe pack these entities belong to.
entitiesarrayrequiredBodyArray of partial entity updates.
entities[].idstringrequiredBodyID of the entity to update.
entities[].namestringBodyUpdated name.
entities[].visiblebooleanBodyUpdated visibility.
entities[].position{ x, y, z }BodyUpdated position in meters.
entities[].quaternion{ x, y, z, w }BodyUpdated rotation.
entities[].size{ x, y, z }BodyUpdated dimensions in meters.
curl -X POST https://steady-beagle-345.convex.site/api/v1/entities:batchUpdate \
-H "Authorization: Bearer tp_your-api-key" \
-H "Content-Type: application/json" \
-d '{
"packId": "PACK_ID",
"entities": [
{
"id": "ENTITY_ID",
"name": "Renamed Box #1",
"position": { "x": 1, "y": 0, "z": 0 },
"visible": false
}
]
}'Batch Delete Entities
/api/v1/entities:batchDeleteBatch delete entities and all their children from a pack. Child entities are automatically deleted recursively.
Parameters
packIdstringrequiredBodyThe pack these entities belong to.
idsstring[]requiredBodyArray of entity IDs to delete.
curl -X POST https://steady-beagle-345.convex.site/api/v1/entities:batchDelete \
-H "Authorization: Bearer tp_your-api-key" \
-H "Content-Type: application/json" \
-d '{
"packId": "PACK_ID",
"ids": ["ENTITY_ID_1", "ENTITY_ID_2"]
}'