Kubova.
← Home

Kubova REST API

Pack containers from any language. Bearer auth, JSON in / JSON out.

Your API data is not stored

Kubova does not save the cargo you send or the plans it returns through the API or an AI assistant connection. Each result goes straight back to the app or assistant that asked for it and does not appear in your saved packs. We only keep a log of the call itself (time and network address), for your plan's quota, security and abuse protection. To keep a plan, save it on your side or run it in the calculator and click Save.

Looking for MCP setup? Read the MCP guide →

Authentication

Every request needs an API key in the Authorization header:

Authorization: Bearer kbv_abc123...

Generate keys from the dashboard once you're on the Pro plan.

Manage API keys →

Verify a key

Use the /me endpoint to confirm your key is valid before sending pack requests:

curl https://kubova.com/api/v1/me \
  -H "Authorization: Bearer kbv_..."

Pack containers

POST to /api/v1/pack with cargos and a container. The packer returns placements per container, used volume, and any unplaced pieces.

curl -X POST https://kubova.com/api/v1/pack \
  -H "Authorization: Bearer kbv_..." \
  -H "Content-Type: application/json" \
  -d '{
    "cargos": [{
      "id": "sku-a",
      "name": "Box A",
      "shape": "box",
      "lengthCm": 50, "widthCm": 40, "heightCm": 30,
      "quantity": 20,
      "weightKg": 5,
      "color": "#e85d3a",
      "includeInLoading": true,
      "allowStacking": true,
      "allowRotation": true
    }],
    "container": {
      "id": "40hc",
      "name": "40 HC",
      "innerLengthCm": 1203.5,
      "innerWidthCm": 235.2,
      "innerHeightCm": 269.5,
      "doorWidthCm": 234,
      "doorHeightCm": 257.7,
      "maxPayloadKg": 28620
    },
    "options": {
      "loadingDirection": "floor-to-top",
      "optimizeTimeMs": 5000
    }
  }'

On success returns ok=true with result.containers and result.unplaced. On error returns ok=false with an error string.

Generate a PDF report

POST to /api/v1/report with the same body shape as /pack. format=json returns base64 PDF + 3D PNG per container; format=binary streams a single combined PDF you can save directly.

# JSON response: base64 PDF + 3D PNG per container
curl -X POST https://kubova.com/api/v1/report \
  -H "Authorization: Bearer kbv_..." \
  -H "Content-Type: application/json" \
  -d '{ "cargos": [...], "container": {...}, "format": "json" }'

# Binary response: a single combined PDF
curl -X POST "https://kubova.com/api/v1/report?format=binary" \
  -H "Authorization: Bearer kbv_..." \
  -H "Content-Type: application/json" \
  -d '{ "cargos": [...], "container": {...} }' \
  --output kubova-report.pdf

Needs the report scope on the key. New keys ship with both pack and report.

Rate limits & timeouts

  • Default 60 requests per minute per key (configurable per-key on request).
  • Pack requests time out after 290 seconds. That covers every workload we've seen so far; the asynchronous job pattern lands when real users start hitting the ceiling.
  • Each key has a scope set (pack, report). The /pack endpoint needs the pack scope.
  • API access is available on the Pro plan and above.

Error codes

ErrorHTTPMeaning
missing_bearer_token401No Authorization header was sent.
invalid_token401The token does not match any active key.
token_revoked401The key was revoked from the dashboard.
token_expired401The key passed its expiration date.
scope_missing:pack403The key does not have the required scope.
rate_limit_exceeded429More than 60 requests in the last minute.
invalid_request400The request is incomplete or invalid (for example no container). The detail field says what to fix.
upstream_unreachable502The packing service was unreachable. Retry after a backoff.