Developer API

Nestpact API

A stable, versioned REST API for driving Nestpact from your own tooling: upload sheets and parts, start a nest, poll for the result, and download the layout as a DXF. Every call runs through the same engine as the app, so the API and the UI never drift.

Base URL

https://nestpact.app/api/v1

Authentication

Create a key in the app under Settings → API keys (your account needs API access enabled). Send it on every request as a bearer token or an X-API-Key header. The secret is shown once at creation, so store it safely.

Authorization: Bearer sk_live_your_key_here
# or
X-API-Key: sk_live_your_key_here

End-to-end example

Start a nest, poll until it completes, then download the DXF. Pick your language:

# 1. Verify your key and see your plan + remaining quota
curl https://nestpact.app/api/v1/account \
  -H "Authorization: Bearer sk_live_your_key_here"

# 2. Start a nest from two rectangles on a 1000x500 sheet
curl -X POST https://nestpact.app/api/v1/nest \
  -H "Authorization: Bearer sk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "material_coords": [[0,0],[1000,0],[1000,500],[0,500]],
    "manual_parts": [
      {"name": "bracket", "width": 120, "height": 80, "quantity": 6}
    ],
    "optimization": "standard"
  }'
# -> { "job_id": "…", "status": "queued" }

# 3. Poll until status == "completed"
curl https://nestpact.app/api/v1/nest/JOB_ID \
  -H "Authorization: Bearer sk_live_your_key_here"

# 4. Download the nested DXF
curl https://nestpact.app/api/v1/nest/JOB_ID/dxf \
  -H "Authorization: Bearer sk_live_your_key_here" \
  -o nested.dxf

Response

A completed GET /nest/{id} returns the job summary. Read status to know when it is done, utilization for the packing density, and fetch /nest/{id}/dxf for the layout itself.

{
  "job_id": "8f3c1a90-1e2b-4c77-9b0e-2a1f6d4c8e10",
  "status": "completed",
  "utilization": 82.4,
  "placed_count": 6,
  "unplaced_count": 0,
  "elapsed_time": 3.1,
  "success_rate": 100.0,
  "placements": [
    { "name": "bracket", "pos_x": 120.0, "pos_y": 80.0,
      "rotation": 90.0, "placed": true }
  ]
}

# Then fetch the layout itself:
#   GET /api/v1/nest/8f3c1a90.../dxf

Endpoints

MethodPathDescription
GET/accountVerify the key; returns plan, tier and remaining quota.
POST/materialsUpload a sheet/material DXF. Returns a material_id.
POST/partsUpload one or more part files. Returns part ids.
POST/nestStart a nesting job. Returns a job_id.
GET/nest/{id}Poll a job: queued / processing / completed / failed.
GET/nest/{id}/dxfDownload the nested layout as a DXF (once completed).

The /nest body is the same shape the app posts: a material (material_id or material_coords), parts (part_ids or manual_parts), and parameters like gap_mm, rotation_step and optimization. Subscription tier, preset access and quota apply exactly as they do in the app.

Nest parameters

Every field accepted in the POST /nest body. Supply a material and parts; everything else is optional and falls back to the default.

FieldTypeDefaultDescription
material_idstringSheet from POST /materials. Use this OR material_coords.
material_coordsnumber[][]Sheet outline as [[x, y], …] in mm. Use this OR material_id.
part_idsstring[]Parts from POST /parts. Use this OR manual_parts.
manual_partsobject[]Rectangles: { name, width, height, quantity }. No upload needed.
optimizationstringstandardfast · light · standard · deep · genetic · nfp (tier-gated).
rotation_stepstring30none · grain · 90 · 45 · 30 · 15 · free (degrees).
sorting_strategystringareaarea · width · height.
gap_mmnumber2.0Clearance left between parts.
edge_offset_mmnumber5.0Margin kept clear from the sheet edge.
kerf_mmnumber0.0Cut width compensation (laser/plasma/waterjet).
tool_diameter_mmnumber0.0Router bit diameter; added to the gap.
hole_fillingbooleantrueNest small parts inside larger parts' through-holes.
fill_remainingbooleanfalseDuplicate small parts to fill leftover sheet space.
nest_originstringblPacking corner: bl · tl · tr · br.
fill_directionstringyGrowth direction: y · x.
unitsstringmmmm · in. Display/reporting only; math is always mm.
ignored_layersstring[][]Layer names to drop before nesting and from export.
stop_conditions_enabledbooleanfalseRun the iterative optimiser until a stop target is met.
stop_time_snumber300With stop conditions: time budget (hard-capped server-side).

The GET /nest/{id}/dxf download also accepts parts_only and optimize_cut_path as query parameters.

Rate limits

Calls are rate-limited per key across three independent sliding windows (per minute, per hour, per day). Each response carries X-RateLimit-* headers so you can self-throttle; exceeding a window returns 429 with a Retry-After. Your subscription's monthly nesting quota applies separately and limits how many jobs you can start.

Errors

StatusMeaning
401Missing, invalid or revoked key.
403API access not enabled for the account.
429Rate limit hit. Back off per Retry-After.
503The public API is currently turned off.

Create an API key →Back to docs