DocsAPI Reference

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
  • orgId is 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

Authorizationstringrequired

Bearer token in the format: Bearer tp_your-api-key

cURL
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-api.md
# 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

GET/api/v1/cases

Returns all cases belonging to the authenticated organization.

cURL
curl https://steady-beagle-345.convex.site/api/v1/cases \
  -H "Authorization: Bearer tp_your-api-key"

Get Case by ID

GET/api/v1/cases/:id

Returns a single case by its ID.

Parameters

idstringrequiredPath

The case ID.

cURL
curl https://steady-beagle-345.convex.site/api/v1/cases/CASE_ID \
  -H "Authorization: Bearer tp_your-api-key"

Create Case

POST/api/v1/cases

Create a new case (box type). The orgId is inferred from the API key.

Parameters

namestringrequiredBody

Case name.

dxnumberrequiredBody

Length in meters.

dynumberrequiredBody

Width in meters.

dznumberrequiredBody

Height in meters.

canRotate3dbooleanrequiredBody

Whether the case can rotate freely on any axis.

categoryIdstringrequiredBody

ID of the case category.

descriptionstringBody

Optional description.

manufacturerstringBody

Manufacturer name.

weightnumberBody

Weight in kilograms.

cURL
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

PUT/api/v1/cases/:id

Update an existing case. Pass the case ID in the URL path.

Parameters

idstringrequiredPath

The case ID.

namestringBody

Case name.

descriptionstringBody

Description.

manufacturerstringBody

Manufacturer name.

weightnumberBody

Weight in kilograms.

dxnumberBody

Length in meters.

dynumberBody

Width in meters.

dznumberBody

Height in meters.

canRotate3dbooleanBody

Whether AutoPack can rotate freely.

categoryIdstringBody

Case category ID.

cURL
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

DELETE/api/v1/cases/:id

Permanently delete a case by its ID.

Parameters

idstringrequiredPath

The case ID.

cURL
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

GET/api/v1/case-categories

Returns all case categories for the authenticated organization.

cURL
curl https://steady-beagle-345.convex.site/api/v1/case-categories \
  -H "Authorization: Bearer tp_your-api-key"

Create Case Category

POST/api/v1/case-categories

Create a new case category.

Parameters

namestringrequiredBody

Category name.

colorHexstringrequiredBody

Hex color code (e.g. "#FF4444").

cURL
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

PUT/api/v1/case-categories/:id

Update an existing case category.

Parameters

idstringrequiredPath

Category ID.

namestringBody

Category name.

colorHexstringBody

Hex color code.

cURL
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

DELETE/api/v1/case-categories/:id

Delete a case category by its ID.

Parameters

idstringrequiredPath

Category ID.

cURL
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

GET/api/v1/containers

Returns all containers for the authenticated organization.

cURL
curl https://steady-beagle-345.convex.site/api/v1/containers \
  -H "Authorization: Bearer tp_your-api-key"

Get Container by ID

GET/api/v1/containers/:id

Returns a single container by its ID.

Parameters

idstringrequiredPath

Container ID.

cURL
curl https://steady-beagle-345.convex.site/api/v1/containers/CONTAINER_ID \
  -H "Authorization: Bearer tp_your-api-key"

Create Container

POST/api/v1/containers

Create a new container (truck/trailer/shipping container).

Parameters

namestringrequiredBody

Container name.

typestringrequiredBody

One of: dry_container, boxcar, flatbed_trailer, step_deck_trailer, dry_van_trailer, reefer_van_trailer, box_truck, uld.

dxnumberrequiredBody

Length in meters.

dynumberrequiredBody

Width in meters.

dznumberrequiredBody

Height in meters.

descriptionstringBody

Optional description.

codestringBody

Optional code identifier.

payloadCapacitynumberBody

Max payload in kilograms.

cURL
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

PUT/api/v1/containers/:id

Update an existing container.

Parameters

idstringrequiredPath

Container ID.

namestringBody

Container name.

descriptionstringBody

Description.

codestringBody

Code identifier.

typestringBody

Container type.

dxnumberBody

Length in meters.

dynumberBody

Width in meters.

dznumberBody

Height in meters.

payloadCapacitynumberBody

Max payload in kg.

cURL
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

DELETE/api/v1/containers/:id

Permanently delete a container by its ID.

Parameters

idstringrequiredPath

Container ID.

cURL
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

GET/api/v1/packs

Returns all packs for the authenticated organization.

cURL
curl https://steady-beagle-345.convex.site/api/v1/packs \
  -H "Authorization: Bearer tp_your-api-key"

Get Pack by ID

GET/api/v1/packs/:id

Returns a single pack by its ID.

Parameters

idstringrequiredPath

The pack ID.

cURL
curl https://steady-beagle-345.convex.site/api/v1/packs/PACK_ID \
  -H "Authorization: Bearer tp_your-api-key"

Get Pack Entities

GET/api/v1/packs/:id/entities

Returns all entities (cases, containers, groups) within a specific pack. Excludes soft-deleted entities.

Parameters

idstringrequiredPath

The pack ID.

cURL
curl https://steady-beagle-345.convex.site/api/v1/packs/PACK_ID/entities \
  -H "Authorization: Bearer tp_your-api-key"

Create Pack

POST/api/v1/packs

Create a new pack (loading plan).

Parameters

namestringBody

Pack name.

folderIdstringBody

Optional folder ID to place the pack in.

cURL
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

DELETE/api/v1/packs/:id

Permanently delete a pack and all its entities, export views, and preview thumbnails.

Parameters

idstringrequiredPath

The pack ID.

cURL
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

GET/api/v1/entities?packId=:packId

Returns all entities for a specific pack. The packId query parameter is required.

Parameters

packIdstringrequiredQuery

The pack ID to fetch entities for.

cURL
curl "https://steady-beagle-345.convex.site/api/v1/entities?packId=PACK_ID" \
  -H "Authorization: Bearer tp_your-api-key"

Batch Create Entities

POST/api/v1/entities:batchCreate

Batch create entities within a pack.

Parameters

entitiesarrayrequiredBody

Array of entity objects to create.

entities[].namestringrequiredBody

Entity name.

entities[].typestringrequiredBody

One of: case, container, group.

entities[].packIdstringrequiredBody

Pack ID this entity belongs to.

entities[].visiblebooleanrequiredBody

Whether the entity is visible.

entities[].childrenIdsstring[]requiredBody

Array of child entity IDs (empty for leaf nodes).

entities[].position{ x, y, z }requiredBody

Position in meters.

entities[].quaternion{ x, y, z, w }requiredBody

Rotation quaternion. Use {0,0,0,1} for no rotation.

entities[].size{ x, y, z }requiredBody

Dimensions in meters.

entities[].caseDataobjectBody

Required for case type: { weight?, manufacturer?, canRotate3d, categoryId }.

entities[].containerDataobjectBody

Required for container type: { type, payloadCapacity? }.

entities[].groupDataobjectBody

For group type: { colorHex }.

cURL
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

POST/api/v1/entities:batchUpdate

Batch update entities within a pack. Only include the fields you want to change.

Parameters

packIdstringrequiredBody

The pack these entities belong to.

entitiesarrayrequiredBody

Array of partial entity updates.

entities[].idstringrequiredBody

ID of the entity to update.

entities[].namestringBody

Updated name.

entities[].visiblebooleanBody

Updated visibility.

entities[].position{ x, y, z }Body

Updated position in meters.

entities[].quaternion{ x, y, z, w }Body

Updated rotation.

entities[].size{ x, y, z }Body

Updated dimensions in meters.

cURL
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

POST/api/v1/entities:batchDelete

Batch delete entities and all their children from a pack. Child entities are automatically deleted recursively.

Parameters

packIdstringrequiredBody

The pack these entities belong to.

idsstring[]requiredBody

Array of entity IDs to delete.

cURL
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"]
  }'
Truck Packer REST API v1 · Backline Logic