---
title: Prechecks
description: The Prechecks API answers before you start: how a STEP file's calculation splits into made and catalogue parts, how many calculations it takes and their cost.
---

# Prechecks

The Prechecks API answers before you start: how a STEP file's calculation splits into made and catalogue parts, how many calculations it takes and their cost.

> **Auto-generated** from the public OpenAPI spec — this page never
> drifts from the running API. Base URL `https://api.arcnm.io`. Authenticate with
> the `X-API-Key` header (see [Authentication](../authentication.md)).

## A drop's prechecks, answered together

`GET /api/v1/prechecks`

Every precheck of one drop, answered in the order the files will be
started — the order they draw on your plan — so the totals are what
starting them all costs.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `batch_id` | query | string | yes | The drop. |

**Request**

<CodeTabs>

```bash title="cURL"
curl -X GET https://api.arcnm.io/api/v1/prechecks \
  -H "X-API-Key: $ARCNM_API_KEY"
```

```python title="Python"
import requests

resp = requests.get(
    "https://api.arcnm.io/api/v1/prechecks",
    headers={"X-API-Key": "YOUR_API_KEY"},
)
resp.raise_for_status()
print(resp.json())
```

```typescript title="TypeScript"
const resp = await fetch("https://api.arcnm.io/api/v1/prechecks", {
  method: "GET",
  headers: {
    "X-API-Key": process.env.ARCNM_API_KEY!,
  },
})
const data = await resp.json()
```

</CodeTabs>

**Responses**

| Status | Description |
| --- | --- |
| `200` | Successful Response |
| `422` | Validation Error |
| `default` | Error — the error envelope; branch on `error.code`. |

**Errors**

Standard error responses — see the [Errors catalog](../errors.md) for the full envelope, `request_id`, and retry-safety table.

| Status | Code | When |
| --- | --- | --- |
| `401` | `invalid_api_key` | Missing, malformed, or revoked API key. |
| `403` | `insufficient_scope` | The key is valid but lacks a scope this endpoint requires. |
| `429` | `rate_limited` | Per-key or per-org rate limit exceeded — back off with jitter and retry. |


**Response body** `200`

| Field | Type | Description |
| --- | --- | --- |
| `prechecks` | PrecheckOut[] |  |
| `quota` | PrecheckQuotaOut |  |
| `totals` | PrecheckTotalsOut |  |

**Example response**

```json
{
  "prechecks": [
    {
      "batch_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "drawings": [
        {}
      ],
      "error_code": "budget",
      "expires_at": "2026-06-01T12:00:00Z",
      "filename": "bracket.step",
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "kind": "assembly",
      "nodes": [
        {}
      ],
      "per_part": true,
      "position": 0,
      "quota": {
        "overage_allowed": true,
        "overage_cents_each": 0,
        "remaining_after": 0,
        "remaining_before": 0
      },
      "revision": "string",
      "rows": [
        {}
      ],
      "sha256": "9f86d081884c7d659a2feaa0c55ad015…",
      "size_bytes": 204800,
      "skipped_files": [
        {}
      ],
      "stage": "queued",
      "started_calculation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "status": "received",
      "totals": {
        "capped": 0,
        "catalogue": 0,
        "dispatched": 0,
        "excluded": 0,
        "free": 0,
        "held": 0,
        "included": 0,
        "made": 0,
        "metered_max": 0,
        "overage": 0,
        "overage_cents": 0,
        "pieces": 0,
        "rows": 0
      }
    }
  ],
  "quota": {
    "overage_allowed": true,
    "overage_cents_each": 0,
    "remaining_after": 0,
    "remaining_before": 0
  },
  "totals": {
    "capped": 0,
    "catalogue": 0,
    "dispatched": 0,
    "excluded": 0,
    "free": 0,
    "held": 0,
    "included": 0,
    "made": 0,
    "metered_max": 0,
    "overage": 0,
    "overage_cents": 0,
    "pieces": 0,
    "rows": 0
  }
}
```

## Precheck a file: how its calculation splits, counts and costs

`POST /api/v1/prechecks`

Store a file and read it the way its calculation will — free, metered
never. Answers at once with `status` `received`; send `Prefer: wait=3` to
wait up to that many seconds for the answer. Poll `GET /prechecks/{id}`
until `status` is no longer `received`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Prefer` | header | string | no |  |

**Request body** (`multipart/form-data`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `batch_id` | string | no | Groups the files of one drop; they are answered in `position` order. |
| `cad_file` | string | yes | STEP file (.step/.stp) to precheck; gzip-compressed is accepted. |
| `drawing_files` | string[] | no | Drawings (PDF, PNG, JPEG) of the assembly or its parts. |
| `part_number` | string | no | The part number it will be started under. |
| `position` | integer | no | Order of this file in its drop. |

**Request**

<CodeTabs>

```bash title="cURL"
curl -X POST https://api.arcnm.io/api/v1/prechecks \
  -H "X-API-Key: $ARCNM_API_KEY" \
  -F "cad_file=@part.step"
```

```python title="Python"
import requests

resp = requests.post(
    "https://api.arcnm.io/api/v1/prechecks",
    headers={"X-API-Key": "YOUR_API_KEY"},
    files={
        "cad_file": open("part.step", "rb"),
    },
)
resp.raise_for_status()
print(resp.json())
```

```typescript title="TypeScript"
const form = new FormData()
form.append("cad_file", file) // a File or Blob

const resp = await fetch("https://api.arcnm.io/api/v1/prechecks", {
  method: "POST",
  headers: { "X-API-Key": process.env.ARCNM_API_KEY! },
  body: form,
})
const data = await resp.json()
```

</CodeTabs>

**Responses**

| Status | Description |
| --- | --- |
| `202` | Successful Response |
| `422` | Validation Error |
| `default` | Error — the error envelope; branch on `error.code`. |

**Errors**

Standard error responses — see the [Errors catalog](../errors.md) for the full envelope, `request_id`, and retry-safety table.

| Status | Code | When |
| --- | --- | --- |
| `401` | `invalid_api_key` | Missing, malformed, or revoked API key. |
| `403` | `insufficient_scope` | The key is valid but lacks a scope this endpoint requires. |
| `409` | `conflict` | A conflicting change, or an `Idempotency-Key` reused with a different body. |
| `429` | `rate_limited` | Per-key or per-org rate limit exceeded — back off with jitter and retry. |


**Response body** `202`

| Field | Type | Description |
| --- | --- | --- |
| `batch_id` | string |  |
| `drawings` | PrecheckDrawingOut[] | Every drawing it holds, in the order they were added. |
| `error_code` | `budget` \| `unreadable` \| `too_complex` \| `internal` |  |
| `expires_at` | string |  |
| `filename` | string |  |
| `id` | string |  |
| `kind` | `assembly` \| `part` \| `unknown` | `assembly`: it splits into parts. `part`: one calculation. `unknown`: not answered. |
| `nodes` | AssemblyBomNodeOut[] |  |
| `per_part` | boolean | Deprecated: always true. Each different made part of an assembly is one calculation; an assembly is never priced as one calculation for all its parts. |
| `position` | integer |  |
| `quota` | PrecheckQuotaOut |  |
| `revision` | string | Send it with the start: a precheck that changed since answers 409. |
| `rows` | PrecheckRowOut[] | The bill of materials, in position order. |
| `sha256` | string | The server's SHA-256 of the stored file, hex. |
| `size_bytes` | integer |  |
| `skipped_files` | SkippedUploadFile[] | Drawings this call sent that do not open, left out with their reason; the others were taken. Null when every file was taken. |
| `stage` | `queued` \| `reading` \| `drawings` |  |
| `started_calculation_id` | string |  |
| `status` | `received` \| `ready` \| `degraded` \| `failed` \| `started` \| `expired` | `received`: reading. `ready`: answered. `degraded` / `failed`: no answer (`error_code`) — starting still works. `started`: a calculation was created from it. `expired`: never started; its files are gone. |
| `totals` | PrecheckTotalsOut |  |

**Example response**

```json
{
  "batch_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "drawings": [
    {
      "basis": "string",
      "component_key": "string",
      "data_source_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "drawing_number": "string",
      "filename": "bracket.step",
      "material": "string",
      "sha256": "9f86d081884c7d659a2feaa0c55ad015…",
      "status": "pending"
    }
  ],
  "error_code": "budget",
  "expires_at": "2026-06-01T12:00:00Z",
  "filename": "bracket.step",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "kind": "assembly",
  "nodes": [
    {
      "components_cost_per_instance": 0,
      "instances": 0,
      "instances_per_parent": 0,
      "name": "string",
      "node_id": "string",
      "own_cost_per_instance": 0,
      "own_time_s_per_instance": 0,
      "parent_id": "string",
      "path": [
        "string"
      ],
      "priced_complete": true,
      "subtotal": 0,
      "subtotal_per_instance": 0
    }
  ],
  "per_part": true,
  "position": 0,
  "quota": {
    "overage_allowed": true,
    "overage_cents_each": 0,
    "remaining_after": 0,
    "remaining_before": 0
  },
  "revision": "string",
  "rows": [
    {
      "assembly_path": [
        "string"
      ],
      "component_key": "string",
      "designation": "string",
      "drawing": {
        "basis": "string",
        "data_source_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "drawing_number": "string",
        "filename": "bracket.step",
        "material": "string",
        "title": "string"
      },
      "drawing_number": "string",
      "fate": "catalogue",
      "held_reason": "wallet_empty",
      "label": "string",
      "named_material": {
        "source": "drawing",
        "text": "string"
      },
      "part_number": "BRACKET-001",
      "part_number_source": "drawing_part_number",
      "placements": [
        {}
      ],
      "position": 0,
      "procurement": {
        "basis": "string",
        "category": "string",
        "decision": "make",
        "kind": "string",
        "match": "string",
        "nominal_m": 0,
        "standard": "string"
      },
      "product_id": "string",
      "purchased_assembly": {
        "n_parts": 0
      },
      "qty_per": 0,
      "sourcing": "make",
      "statement": {
        "excluded": true,
        "inherited": false,
        "material_display_code": "string",
        "material_grade_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "purchased": true,
        "purchased_unit_price": 0
      }
    }
  ],
  "sha256": "9f86d081884c7d659a2feaa0c55ad015…",
  "size_bytes": 204800,
  "skipped_files": [
    {
      "code": "string",
      "filename": "bracket.step"
    }
  ],
  "stage": "queued",
  "started_calculation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "received",
  "totals": {
    "capped": 0,
    "catalogue": 0,
    "dispatched": 0,
    "excluded": 0,
    "free": 0,
    "held": 0,
    "included": 0,
    "made": 0,
    "metered_max": 0,
    "overage": 0,
    "overage_cents": 0,
    "pieces": 0,
    "rows": 0
  }
}
```

## Discard a precheck and its files

`DELETE /api/v1/prechecks/{precheck_id}`

The files go at once, and the precheck answers `expired`. A started
precheck's files are the calculation's and stay.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `precheck_id` | path | string | yes | Identifier of the precheck. |

**Request**

<CodeTabs>

```bash title="cURL"
curl -X DELETE https://api.arcnm.io/api/v1/prechecks/{precheck_id} \
  -H "X-API-Key: $ARCNM_API_KEY"
```

```python title="Python"
import requests

resp = requests.delete(
    "https://api.arcnm.io/api/v1/prechecks/{precheck_id}",
    headers={"X-API-Key": "YOUR_API_KEY"},
)
resp.raise_for_status()
print(resp.json())
```

```typescript title="TypeScript"
const resp = await fetch("https://api.arcnm.io/api/v1/prechecks/{precheck_id}", {
  method: "DELETE",
  headers: {
    "X-API-Key": process.env.ARCNM_API_KEY!,
  },
})
const data = await resp.json()
```

</CodeTabs>

**Responses**

| Status | Description |
| --- | --- |
| `200` | Successful Response |
| `422` | Validation Error |
| `default` | Error — the error envelope; branch on `error.code`. |

**Errors**

Standard error responses — see the [Errors catalog](../errors.md) for the full envelope, `request_id`, and retry-safety table.

| Status | Code | When |
| --- | --- | --- |
| `401` | `invalid_api_key` | Missing, malformed, or revoked API key. |
| `403` | `insufficient_scope` | The key is valid but lacks a scope this endpoint requires. |
| `404` | `not_found` | A referenced resource doesn't exist or isn't visible to your organisation. |
| `409` | `conflict` | A conflicting change, or an `Idempotency-Key` reused with a different body. |
| `429` | `rate_limited` | Per-key or per-org rate limit exceeded — back off with jitter and retry. |


**Response body** `200`

| Field | Type | Description |
| --- | --- | --- |
| `batch_id` | string |  |
| `drawings` | PrecheckDrawingOut[] | Every drawing it holds, in the order they were added. |
| `error_code` | `budget` \| `unreadable` \| `too_complex` \| `internal` |  |
| `expires_at` | string |  |
| `filename` | string |  |
| `id` | string |  |
| `kind` | `assembly` \| `part` \| `unknown` | `assembly`: it splits into parts. `part`: one calculation. `unknown`: not answered. |
| `nodes` | AssemblyBomNodeOut[] |  |
| `per_part` | boolean | Deprecated: always true. Each different made part of an assembly is one calculation; an assembly is never priced as one calculation for all its parts. |
| `position` | integer |  |
| `quota` | PrecheckQuotaOut |  |
| `revision` | string | Send it with the start: a precheck that changed since answers 409. |
| `rows` | PrecheckRowOut[] | The bill of materials, in position order. |
| `sha256` | string | The server's SHA-256 of the stored file, hex. |
| `size_bytes` | integer |  |
| `skipped_files` | SkippedUploadFile[] | Drawings this call sent that do not open, left out with their reason; the others were taken. Null when every file was taken. |
| `stage` | `queued` \| `reading` \| `drawings` |  |
| `started_calculation_id` | string |  |
| `status` | `received` \| `ready` \| `degraded` \| `failed` \| `started` \| `expired` | `received`: reading. `ready`: answered. `degraded` / `failed`: no answer (`error_code`) — starting still works. `started`: a calculation was created from it. `expired`: never started; its files are gone. |
| `totals` | PrecheckTotalsOut |  |

**Example response**

```json
{
  "batch_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "drawings": [
    {
      "basis": "string",
      "component_key": "string",
      "data_source_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "drawing_number": "string",
      "filename": "bracket.step",
      "material": "string",
      "sha256": "9f86d081884c7d659a2feaa0c55ad015…",
      "status": "pending"
    }
  ],
  "error_code": "budget",
  "expires_at": "2026-06-01T12:00:00Z",
  "filename": "bracket.step",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "kind": "assembly",
  "nodes": [
    {
      "components_cost_per_instance": 0,
      "instances": 0,
      "instances_per_parent": 0,
      "name": "string",
      "node_id": "string",
      "own_cost_per_instance": 0,
      "own_time_s_per_instance": 0,
      "parent_id": "string",
      "path": [
        "string"
      ],
      "priced_complete": true,
      "subtotal": 0,
      "subtotal_per_instance": 0
    }
  ],
  "per_part": true,
  "position": 0,
  "quota": {
    "overage_allowed": true,
    "overage_cents_each": 0,
    "remaining_after": 0,
    "remaining_before": 0
  },
  "revision": "string",
  "rows": [
    {
      "assembly_path": [
        "string"
      ],
      "component_key": "string",
      "designation": "string",
      "drawing": {
        "basis": "string",
        "data_source_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "drawing_number": "string",
        "filename": "bracket.step",
        "material": "string",
        "title": "string"
      },
      "drawing_number": "string",
      "fate": "catalogue",
      "held_reason": "wallet_empty",
      "label": "string",
      "named_material": {
        "source": "drawing",
        "text": "string"
      },
      "part_number": "BRACKET-001",
      "part_number_source": "drawing_part_number",
      "placements": [
        {}
      ],
      "position": 0,
      "procurement": {
        "basis": "string",
        "category": "string",
        "decision": "make",
        "kind": "string",
        "match": "string",
        "nominal_m": 0,
        "standard": "string"
      },
      "product_id": "string",
      "purchased_assembly": {
        "n_parts": 0
      },
      "qty_per": 0,
      "sourcing": "make",
      "statement": {
        "excluded": true,
        "inherited": false,
        "material_display_code": "string",
        "material_grade_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "purchased": true,
        "purchased_unit_price": 0
      }
    }
  ],
  "sha256": "9f86d081884c7d659a2feaa0c55ad015…",
  "size_bytes": 204800,
  "skipped_files": [
    {
      "code": "string",
      "filename": "bracket.step"
    }
  ],
  "stage": "queued",
  "started_calculation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "received",
  "totals": {
    "capped": 0,
    "catalogue": 0,
    "dispatched": 0,
    "excluded": 0,
    "free": 0,
    "held": 0,
    "included": 0,
    "made": 0,
    "metered_max": 0,
    "overage": 0,
    "overage_cents": 0,
    "pieces": 0,
    "rows": 0
  }
}
```

## One precheck

`GET /api/v1/prechecks/{precheck_id}`

The precheck and, once read, its answer.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `precheck_id` | path | string | yes | The precheck, as precheck_part returned it. |

**Request**

<CodeTabs>

```bash title="cURL"
curl -X GET https://api.arcnm.io/api/v1/prechecks/{precheck_id} \
  -H "X-API-Key: $ARCNM_API_KEY"
```

```python title="Python"
import requests

resp = requests.get(
    "https://api.arcnm.io/api/v1/prechecks/{precheck_id}",
    headers={"X-API-Key": "YOUR_API_KEY"},
)
resp.raise_for_status()
print(resp.json())
```

```typescript title="TypeScript"
const resp = await fetch("https://api.arcnm.io/api/v1/prechecks/{precheck_id}", {
  method: "GET",
  headers: {
    "X-API-Key": process.env.ARCNM_API_KEY!,
  },
})
const data = await resp.json()
```

</CodeTabs>

**Responses**

| Status | Description |
| --- | --- |
| `200` | Successful Response |
| `422` | Validation Error |
| `default` | Error — the error envelope; branch on `error.code`. |

**Errors**

Standard error responses — see the [Errors catalog](../errors.md) for the full envelope, `request_id`, and retry-safety table.

| Status | Code | When |
| --- | --- | --- |
| `401` | `invalid_api_key` | Missing, malformed, or revoked API key. |
| `403` | `insufficient_scope` | The key is valid but lacks a scope this endpoint requires. |
| `404` | `not_found` | A referenced resource doesn't exist or isn't visible to your organisation. |
| `429` | `rate_limited` | Per-key or per-org rate limit exceeded — back off with jitter and retry. |


**Response body** `200`

| Field | Type | Description |
| --- | --- | --- |
| `batch_id` | string |  |
| `drawings` | PrecheckDrawingOut[] | Every drawing it holds, in the order they were added. |
| `error_code` | `budget` \| `unreadable` \| `too_complex` \| `internal` |  |
| `expires_at` | string |  |
| `filename` | string |  |
| `id` | string |  |
| `kind` | `assembly` \| `part` \| `unknown` | `assembly`: it splits into parts. `part`: one calculation. `unknown`: not answered. |
| `nodes` | AssemblyBomNodeOut[] |  |
| `per_part` | boolean | Deprecated: always true. Each different made part of an assembly is one calculation; an assembly is never priced as one calculation for all its parts. |
| `position` | integer |  |
| `quota` | PrecheckQuotaOut |  |
| `revision` | string | Send it with the start: a precheck that changed since answers 409. |
| `rows` | PrecheckRowOut[] | The bill of materials, in position order. |
| `sha256` | string | The server's SHA-256 of the stored file, hex. |
| `size_bytes` | integer |  |
| `skipped_files` | SkippedUploadFile[] | Drawings this call sent that do not open, left out with their reason; the others were taken. Null when every file was taken. |
| `stage` | `queued` \| `reading` \| `drawings` |  |
| `started_calculation_id` | string |  |
| `status` | `received` \| `ready` \| `degraded` \| `failed` \| `started` \| `expired` | `received`: reading. `ready`: answered. `degraded` / `failed`: no answer (`error_code`) — starting still works. `started`: a calculation was created from it. `expired`: never started; its files are gone. |
| `totals` | PrecheckTotalsOut |  |

**Example response**

```json
{
  "batch_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "drawings": [
    {
      "basis": "string",
      "component_key": "string",
      "data_source_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "drawing_number": "string",
      "filename": "bracket.step",
      "material": "string",
      "sha256": "9f86d081884c7d659a2feaa0c55ad015…",
      "status": "pending"
    }
  ],
  "error_code": "budget",
  "expires_at": "2026-06-01T12:00:00Z",
  "filename": "bracket.step",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "kind": "assembly",
  "nodes": [
    {
      "components_cost_per_instance": 0,
      "instances": 0,
      "instances_per_parent": 0,
      "name": "string",
      "node_id": "string",
      "own_cost_per_instance": 0,
      "own_time_s_per_instance": 0,
      "parent_id": "string",
      "path": [
        "string"
      ],
      "priced_complete": true,
      "subtotal": 0,
      "subtotal_per_instance": 0
    }
  ],
  "per_part": true,
  "position": 0,
  "quota": {
    "overage_allowed": true,
    "overage_cents_each": 0,
    "remaining_after": 0,
    "remaining_before": 0
  },
  "revision": "string",
  "rows": [
    {
      "assembly_path": [
        "string"
      ],
      "component_key": "string",
      "designation": "string",
      "drawing": {
        "basis": "string",
        "data_source_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "drawing_number": "string",
        "filename": "bracket.step",
        "material": "string",
        "title": "string"
      },
      "drawing_number": "string",
      "fate": "catalogue",
      "held_reason": "wallet_empty",
      "label": "string",
      "named_material": {
        "source": "drawing",
        "text": "string"
      },
      "part_number": "BRACKET-001",
      "part_number_source": "drawing_part_number",
      "placements": [
        {}
      ],
      "position": 0,
      "procurement": {
        "basis": "string",
        "category": "string",
        "decision": "make",
        "kind": "string",
        "match": "string",
        "nominal_m": 0,
        "standard": "string"
      },
      "product_id": "string",
      "purchased_assembly": {
        "n_parts": 0
      },
      "qty_per": 0,
      "sourcing": "make",
      "statement": {
        "excluded": true,
        "inherited": false,
        "material_display_code": "string",
        "material_grade_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "purchased": true,
        "purchased_unit_price": 0
      }
    }
  ],
  "sha256": "9f86d081884c7d659a2feaa0c55ad015…",
  "size_bytes": 204800,
  "skipped_files": [
    {
      "code": "string",
      "filename": "bracket.step"
    }
  ],
  "stage": "queued",
  "started_calculation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "received",
  "totals": {
    "capped": 0,
    "catalogue": 0,
    "dispatched": 0,
    "excluded": 0,
    "free": 0,
    "held": 0,
    "included": 0,
    "made": 0,
    "metered_max": 0,
    "overage": 0,
    "overage_cents": 0,
    "pieces": 0,
    "rows": 0
  }
}
```

## State sourcing, prices, materials and drawings before starting

`PATCH /api/v1/prechecks/{precheck_id}`

The same statements a calculation's components take — make, catalogue
part, excluded, as recognised, a purchase price, a material — kept until
the precheck is started and then the calculation's own. Answers with the
new projection.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `precheck_id` | path | string | yes | Identifier of the precheck. |

**Request body** (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `drawings` | object | no | Where a drawing goes, by its `data_source_id`: a `component_key` of `rows`, `assembly`, `discard` (taken out of the precheck; its file is deleted), or null (matched by its names again). A `component_key` the precheck does not hold answers 404 `component_not_found`. |
| `part_number` | string | no | The part number it will be started under; the statements of that part's last calculation are taken over, as a re-upload does. |
| `statements` | PrecheckStatementsPatch | no |  |

**Request**

<CodeTabs>

```bash title="cURL"
curl -X PATCH https://api.arcnm.io/api/v1/prechecks/{precheck_id} \
  -H "X-API-Key: $ARCNM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "drawings": {},
    "part_number": "BRACKET-001",
    "statements": {
      "clear_material": false,
      "component_keys": [
        "string"
      ],
      "material_grade_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "purchased_unit_prices": {},
      "sourcing": "make"
    }
  }'
```

```python title="Python"
import requests

resp = requests.patch(
    "https://api.arcnm.io/api/v1/prechecks/{precheck_id}",
    headers={"X-API-Key": "YOUR_API_KEY"},
    json={
        "drawings": {},
        "part_number": "BRACKET-001",
        "statements": {
            "clear_material": False,
            "component_keys": [
                "string"
            ],
            "material_grade_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
            "purchased_unit_prices": {},
            "sourcing": "make"
        }
    },
)
resp.raise_for_status()
print(resp.json())
```

```typescript title="TypeScript"
const resp = await fetch("https://api.arcnm.io/api/v1/prechecks/{precheck_id}", {
  method: "PATCH",
  headers: {
    "X-API-Key": process.env.ARCNM_API_KEY!,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "drawings": {},
    "part_number": "BRACKET-001",
    "statements": {
      "clear_material": false,
      "component_keys": [
        "string"
      ],
      "material_grade_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "purchased_unit_prices": {},
      "sourcing": "make"
    }
  }),
})
const data = await resp.json()
```

</CodeTabs>

**Responses**

| Status | Description |
| --- | --- |
| `200` | Successful Response |
| `422` | Validation Error |
| `default` | Error — the error envelope; branch on `error.code`. |

**Errors**

Standard error responses — see the [Errors catalog](../errors.md) for the full envelope, `request_id`, and retry-safety table.

| Status | Code | When |
| --- | --- | --- |
| `401` | `invalid_api_key` | Missing, malformed, or revoked API key. |
| `403` | `insufficient_scope` | The key is valid but lacks a scope this endpoint requires. |
| `404` | `not_found` | A referenced resource doesn't exist or isn't visible to your organisation. |
| `409` | `conflict` | A conflicting change, or an `Idempotency-Key` reused with a different body. |
| `429` | `rate_limited` | Per-key or per-org rate limit exceeded — back off with jitter and retry. |


**Response body** `200`

| Field | Type | Description |
| --- | --- | --- |
| `batch_id` | string |  |
| `drawings` | PrecheckDrawingOut[] | Every drawing it holds, in the order they were added. |
| `error_code` | `budget` \| `unreadable` \| `too_complex` \| `internal` |  |
| `expires_at` | string |  |
| `filename` | string |  |
| `id` | string |  |
| `kind` | `assembly` \| `part` \| `unknown` | `assembly`: it splits into parts. `part`: one calculation. `unknown`: not answered. |
| `nodes` | AssemblyBomNodeOut[] |  |
| `per_part` | boolean | Deprecated: always true. Each different made part of an assembly is one calculation; an assembly is never priced as one calculation for all its parts. |
| `position` | integer |  |
| `quota` | PrecheckQuotaOut |  |
| `revision` | string | Send it with the start: a precheck that changed since answers 409. |
| `rows` | PrecheckRowOut[] | The bill of materials, in position order. |
| `sha256` | string | The server's SHA-256 of the stored file, hex. |
| `size_bytes` | integer |  |
| `skipped_files` | SkippedUploadFile[] | Drawings this call sent that do not open, left out with their reason; the others were taken. Null when every file was taken. |
| `stage` | `queued` \| `reading` \| `drawings` |  |
| `started_calculation_id` | string |  |
| `status` | `received` \| `ready` \| `degraded` \| `failed` \| `started` \| `expired` | `received`: reading. `ready`: answered. `degraded` / `failed`: no answer (`error_code`) — starting still works. `started`: a calculation was created from it. `expired`: never started; its files are gone. |
| `totals` | PrecheckTotalsOut |  |

**Example response**

```json
{
  "batch_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "drawings": [
    {
      "basis": "string",
      "component_key": "string",
      "data_source_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "drawing_number": "string",
      "filename": "bracket.step",
      "material": "string",
      "sha256": "9f86d081884c7d659a2feaa0c55ad015…",
      "status": "pending"
    }
  ],
  "error_code": "budget",
  "expires_at": "2026-06-01T12:00:00Z",
  "filename": "bracket.step",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "kind": "assembly",
  "nodes": [
    {
      "components_cost_per_instance": 0,
      "instances": 0,
      "instances_per_parent": 0,
      "name": "string",
      "node_id": "string",
      "own_cost_per_instance": 0,
      "own_time_s_per_instance": 0,
      "parent_id": "string",
      "path": [
        "string"
      ],
      "priced_complete": true,
      "subtotal": 0,
      "subtotal_per_instance": 0
    }
  ],
  "per_part": true,
  "position": 0,
  "quota": {
    "overage_allowed": true,
    "overage_cents_each": 0,
    "remaining_after": 0,
    "remaining_before": 0
  },
  "revision": "string",
  "rows": [
    {
      "assembly_path": [
        "string"
      ],
      "component_key": "string",
      "designation": "string",
      "drawing": {
        "basis": "string",
        "data_source_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "drawing_number": "string",
        "filename": "bracket.step",
        "material": "string",
        "title": "string"
      },
      "drawing_number": "string",
      "fate": "catalogue",
      "held_reason": "wallet_empty",
      "label": "string",
      "named_material": {
        "source": "drawing",
        "text": "string"
      },
      "part_number": "BRACKET-001",
      "part_number_source": "drawing_part_number",
      "placements": [
        {}
      ],
      "position": 0,
      "procurement": {
        "basis": "string",
        "category": "string",
        "decision": "make",
        "kind": "string",
        "match": "string",
        "nominal_m": 0,
        "standard": "string"
      },
      "product_id": "string",
      "purchased_assembly": {
        "n_parts": 0
      },
      "qty_per": 0,
      "sourcing": "make",
      "statement": {
        "excluded": true,
        "inherited": false,
        "material_display_code": "string",
        "material_grade_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "purchased": true,
        "purchased_unit_price": 0
      }
    }
  ],
  "sha256": "9f86d081884c7d659a2feaa0c55ad015…",
  "size_bytes": 204800,
  "skipped_files": [
    {
      "code": "string",
      "filename": "bracket.step"
    }
  ],
  "stage": "queued",
  "started_calculation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "received",
  "totals": {
    "capped": 0,
    "catalogue": 0,
    "dispatched": 0,
    "excluded": 0,
    "free": 0,
    "held": 0,
    "included": 0,
    "made": 0,
    "metered_max": 0,
    "overage": 0,
    "overage_cents": 0,
    "pieces": 0,
    "rows": 0
  }
}
```

## Add drawings to a precheck

`POST /api/v1/prechecks/{precheck_id}/drawings`

Store drawings with the precheck; each goes to the part it names (or
the one you give) when the calculation starts.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `precheck_id` | path | string | yes | Identifier of the precheck. |

**Request body** (`multipart/form-data`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `component_key` | string | no | The part they belong to; omit to match them by their names. |
| `drawing_files` | string[] | yes | PDF, PNG or JPEG drawings. |

**Request**

<CodeTabs>

```bash title="cURL"
curl -X POST https://api.arcnm.io/api/v1/prechecks/{precheck_id}/drawings \
  -H "X-API-Key: $ARCNM_API_KEY" \
  -F "drawing_files=string"
```

```python title="Python"
import requests

resp = requests.post(
    "https://api.arcnm.io/api/v1/prechecks/{precheck_id}/drawings",
    headers={"X-API-Key": "YOUR_API_KEY"},
    data={
        "drawing_files": "string",
    },
)
resp.raise_for_status()
print(resp.json())
```

```typescript title="TypeScript"
const form = new FormData()
form.append("drawing_files", "string")

const resp = await fetch("https://api.arcnm.io/api/v1/prechecks/{precheck_id}/drawings", {
  method: "POST",
  headers: { "X-API-Key": process.env.ARCNM_API_KEY! },
  body: form,
})
const data = await resp.json()
```

</CodeTabs>

**Responses**

| Status | Description |
| --- | --- |
| `202` | Successful Response |
| `422` | Validation Error |
| `default` | Error — the error envelope; branch on `error.code`. |

**Errors**

Standard error responses — see the [Errors catalog](../errors.md) for the full envelope, `request_id`, and retry-safety table.

| Status | Code | When |
| --- | --- | --- |
| `401` | `invalid_api_key` | Missing, malformed, or revoked API key. |
| `403` | `insufficient_scope` | The key is valid but lacks a scope this endpoint requires. |
| `404` | `not_found` | A referenced resource doesn't exist or isn't visible to your organisation. |
| `409` | `conflict` | A conflicting change, or an `Idempotency-Key` reused with a different body. |
| `429` | `rate_limited` | Per-key or per-org rate limit exceeded — back off with jitter and retry. |


**Response body** `202`

| Field | Type | Description |
| --- | --- | --- |
| `batch_id` | string |  |
| `drawings` | PrecheckDrawingOut[] | Every drawing it holds, in the order they were added. |
| `error_code` | `budget` \| `unreadable` \| `too_complex` \| `internal` |  |
| `expires_at` | string |  |
| `filename` | string |  |
| `id` | string |  |
| `kind` | `assembly` \| `part` \| `unknown` | `assembly`: it splits into parts. `part`: one calculation. `unknown`: not answered. |
| `nodes` | AssemblyBomNodeOut[] |  |
| `per_part` | boolean | Deprecated: always true. Each different made part of an assembly is one calculation; an assembly is never priced as one calculation for all its parts. |
| `position` | integer |  |
| `quota` | PrecheckQuotaOut |  |
| `revision` | string | Send it with the start: a precheck that changed since answers 409. |
| `rows` | PrecheckRowOut[] | The bill of materials, in position order. |
| `sha256` | string | The server's SHA-256 of the stored file, hex. |
| `size_bytes` | integer |  |
| `skipped_files` | SkippedUploadFile[] | Drawings this call sent that do not open, left out with their reason; the others were taken. Null when every file was taken. |
| `stage` | `queued` \| `reading` \| `drawings` |  |
| `started_calculation_id` | string |  |
| `status` | `received` \| `ready` \| `degraded` \| `failed` \| `started` \| `expired` | `received`: reading. `ready`: answered. `degraded` / `failed`: no answer (`error_code`) — starting still works. `started`: a calculation was created from it. `expired`: never started; its files are gone. |
| `totals` | PrecheckTotalsOut |  |

**Example response**

```json
{
  "batch_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "drawings": [
    {
      "basis": "string",
      "component_key": "string",
      "data_source_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "drawing_number": "string",
      "filename": "bracket.step",
      "material": "string",
      "sha256": "9f86d081884c7d659a2feaa0c55ad015…",
      "status": "pending"
    }
  ],
  "error_code": "budget",
  "expires_at": "2026-06-01T12:00:00Z",
  "filename": "bracket.step",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "kind": "assembly",
  "nodes": [
    {
      "components_cost_per_instance": 0,
      "instances": 0,
      "instances_per_parent": 0,
      "name": "string",
      "node_id": "string",
      "own_cost_per_instance": 0,
      "own_time_s_per_instance": 0,
      "parent_id": "string",
      "path": [
        "string"
      ],
      "priced_complete": true,
      "subtotal": 0,
      "subtotal_per_instance": 0
    }
  ],
  "per_part": true,
  "position": 0,
  "quota": {
    "overage_allowed": true,
    "overage_cents_each": 0,
    "remaining_after": 0,
    "remaining_before": 0
  },
  "revision": "string",
  "rows": [
    {
      "assembly_path": [
        "string"
      ],
      "component_key": "string",
      "designation": "string",
      "drawing": {
        "basis": "string",
        "data_source_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "drawing_number": "string",
        "filename": "bracket.step",
        "material": "string",
        "title": "string"
      },
      "drawing_number": "string",
      "fate": "catalogue",
      "held_reason": "wallet_empty",
      "label": "string",
      "named_material": {
        "source": "drawing",
        "text": "string"
      },
      "part_number": "BRACKET-001",
      "part_number_source": "drawing_part_number",
      "placements": [
        {}
      ],
      "position": 0,
      "procurement": {
        "basis": "string",
        "category": "string",
        "decision": "make",
        "kind": "string",
        "match": "string",
        "nominal_m": 0,
        "standard": "string"
      },
      "product_id": "string",
      "purchased_assembly": {
        "n_parts": 0
      },
      "qty_per": 0,
      "sourcing": "make",
      "statement": {
        "excluded": true,
        "inherited": false,
        "material_display_code": "string",
        "material_grade_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "purchased": true,
        "purchased_unit_price": 0
      }
    }
  ],
  "sha256": "9f86d081884c7d659a2feaa0c55ad015…",
  "size_bytes": 204800,
  "skipped_files": [
    {
      "code": "string",
      "filename": "bracket.step"
    }
  ],
  "stage": "queued",
  "started_calculation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "received",
  "totals": {
    "capped": 0,
    "catalogue": 0,
    "dispatched": 0,
    "excluded": 0,
    "free": 0,
    "held": 0,
    "included": 0,
    "made": 0,
    "metered_max": 0,
    "overage": 0,
    "overage_cents": 0,
    "pieces": 0,
    "rows": 0
  }
}
```

## Add drawings sent as base64 to a precheck

`POST /api/v1/prechecks/{precheck_id}/drawings/json`

The same drawings, sent as base64: each goes to the part you give (or
the one it names) when the calculation starts. Free, metered never.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `precheck_id` | path | string | yes | Identifier of the precheck. |

**Request body** (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `component_key` | string | no | The part they belong to: a `component_key` of `rows`, or `assembly`; omit to match them by their names. |
| `drawings` | PrecheckDrawingJSON[] | yes | PDF, PNG or JPEG drawings. |

**Request**

<CodeTabs>

```bash title="cURL"
curl -X POST https://api.arcnm.io/api/v1/prechecks/{precheck_id}/drawings/json \
  -H "X-API-Key: $ARCNM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "drawings": [
      {
        "content_type": "string",
        "file_b64": "string",
        "filename": "bracket.step",
        "sha256": "9f86d081884c7d659a2feaa0c55ad015…"
      }
    ]
  }'
```

```python title="Python"
import requests

resp = requests.post(
    "https://api.arcnm.io/api/v1/prechecks/{precheck_id}/drawings/json",
    headers={"X-API-Key": "YOUR_API_KEY"},
    json={
        "drawings": [
            {
                "content_type": "string",
                "file_b64": "string",
                "filename": "bracket.step",
                "sha256": "9f86d081884c7d659a2feaa0c55ad015…"
            }
        ]
    },
)
resp.raise_for_status()
print(resp.json())
```

```typescript title="TypeScript"
const resp = await fetch("https://api.arcnm.io/api/v1/prechecks/{precheck_id}/drawings/json", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.ARCNM_API_KEY!,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "drawings": [
      {
        "content_type": "string",
        "file_b64": "string",
        "filename": "bracket.step",
        "sha256": "9f86d081884c7d659a2feaa0c55ad015…"
      }
    ]
  }),
})
const data = await resp.json()
```

</CodeTabs>

**Responses**

| Status | Description |
| --- | --- |
| `202` | Successful Response |
| `422` | Validation Error |
| `default` | Error — the error envelope; branch on `error.code`. |

**Errors**

Standard error responses — see the [Errors catalog](../errors.md) for the full envelope, `request_id`, and retry-safety table.

| Status | Code | When |
| --- | --- | --- |
| `401` | `invalid_api_key` | Missing, malformed, or revoked API key. |
| `403` | `insufficient_scope` | The key is valid but lacks a scope this endpoint requires. |
| `404` | `not_found` | A referenced resource doesn't exist or isn't visible to your organisation. |
| `409` | `conflict` | A conflicting change, or an `Idempotency-Key` reused with a different body. |
| `429` | `rate_limited` | Per-key or per-org rate limit exceeded — back off with jitter and retry. |


**Response body** `202`

| Field | Type | Description |
| --- | --- | --- |
| `batch_id` | string |  |
| `drawings` | PrecheckDrawingOut[] | Every drawing it holds, in the order they were added. |
| `error_code` | `budget` \| `unreadable` \| `too_complex` \| `internal` |  |
| `expires_at` | string |  |
| `filename` | string |  |
| `id` | string |  |
| `kind` | `assembly` \| `part` \| `unknown` | `assembly`: it splits into parts. `part`: one calculation. `unknown`: not answered. |
| `nodes` | AssemblyBomNodeOut[] |  |
| `per_part` | boolean | Deprecated: always true. Each different made part of an assembly is one calculation; an assembly is never priced as one calculation for all its parts. |
| `position` | integer |  |
| `quota` | PrecheckQuotaOut |  |
| `revision` | string | Send it with the start: a precheck that changed since answers 409. |
| `rows` | PrecheckRowOut[] | The bill of materials, in position order. |
| `sha256` | string | The server's SHA-256 of the stored file, hex. |
| `size_bytes` | integer |  |
| `skipped_files` | SkippedUploadFile[] | Drawings this call sent that do not open, left out with their reason; the others were taken. Null when every file was taken. |
| `stage` | `queued` \| `reading` \| `drawings` |  |
| `started_calculation_id` | string |  |
| `status` | `received` \| `ready` \| `degraded` \| `failed` \| `started` \| `expired` | `received`: reading. `ready`: answered. `degraded` / `failed`: no answer (`error_code`) — starting still works. `started`: a calculation was created from it. `expired`: never started; its files are gone. |
| `totals` | PrecheckTotalsOut |  |

**Example response**

```json
{
  "batch_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "drawings": [
    {
      "basis": "string",
      "component_key": "string",
      "data_source_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "drawing_number": "string",
      "filename": "bracket.step",
      "material": "string",
      "sha256": "9f86d081884c7d659a2feaa0c55ad015…",
      "status": "pending"
    }
  ],
  "error_code": "budget",
  "expires_at": "2026-06-01T12:00:00Z",
  "filename": "bracket.step",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "kind": "assembly",
  "nodes": [
    {
      "components_cost_per_instance": 0,
      "instances": 0,
      "instances_per_parent": 0,
      "name": "string",
      "node_id": "string",
      "own_cost_per_instance": 0,
      "own_time_s_per_instance": 0,
      "parent_id": "string",
      "path": [
        "string"
      ],
      "priced_complete": true,
      "subtotal": 0,
      "subtotal_per_instance": 0
    }
  ],
  "per_part": true,
  "position": 0,
  "quota": {
    "overage_allowed": true,
    "overage_cents_each": 0,
    "remaining_after": 0,
    "remaining_before": 0
  },
  "revision": "string",
  "rows": [
    {
      "assembly_path": [
        "string"
      ],
      "component_key": "string",
      "designation": "string",
      "drawing": {
        "basis": "string",
        "data_source_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "drawing_number": "string",
        "filename": "bracket.step",
        "material": "string",
        "title": "string"
      },
      "drawing_number": "string",
      "fate": "catalogue",
      "held_reason": "wallet_empty",
      "label": "string",
      "named_material": {
        "source": "drawing",
        "text": "string"
      },
      "part_number": "BRACKET-001",
      "part_number_source": "drawing_part_number",
      "placements": [
        {}
      ],
      "position": 0,
      "procurement": {
        "basis": "string",
        "category": "string",
        "decision": "make",
        "kind": "string",
        "match": "string",
        "nominal_m": 0,
        "standard": "string"
      },
      "product_id": "string",
      "purchased_assembly": {
        "n_parts": 0
      },
      "qty_per": 0,
      "sourcing": "make",
      "statement": {
        "excluded": true,
        "inherited": false,
        "material_display_code": "string",
        "material_grade_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "purchased": true,
        "purchased_unit_price": 0
      }
    }
  ],
  "sha256": "9f86d081884c7d659a2feaa0c55ad015…",
  "size_bytes": 204800,
  "skipped_files": [
    {
      "code": "string",
      "filename": "bracket.step"
    }
  ],
  "stage": "queued",
  "started_calculation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "received",
  "totals": {
    "capped": 0,
    "catalogue": 0,
    "dispatched": 0,
    "excluded": 0,
    "free": 0,
    "held": 0,
    "included": 0,
    "made": 0,
    "metered_max": 0,
    "overage": 0,
    "overage_cents": 0,
    "pieces": 0,
    "rows": 0
  }
}
```

## Precheck a file sent as base64

`POST /api/v1/prechecks/json`

The same precheck, for a file sent as base64 — free, metered never.
Waits up to `Prefer: wait=N` seconds (at most 5) for the answer.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Prefer` | header | string | no |  |

**Request body** (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `batch_id` | string | no | Groups the files of one drop; they are answered in position order. |
| `cad_content_type` | string | no | MIME type of the file, when known. |
| `cad_file_b64` | string | yes | Base64 (or a data: URI) of the STEP file; gzip-compressed is accepted. |
| `cad_filename` | string | yes | e.g. frame.step — used for format detection. |
| `cad_sha256` | string | no | SHA-256 of the file itself (before base64 and any gzip), hex. When sent, the file is refused with 422 checksum_mismatch unless it arrived with exactly this digest — nothing is stored or calculated then. |
| `drawings` | PrecheckDrawingJSON[] | no | Drawings of the assembly or its parts. |
| `part_number` | string | no | The part number it will be started under. |
| `position` | integer | no | Order of this file in its drop. |

**Request**

<CodeTabs>

```bash title="cURL"
curl -X POST https://api.arcnm.io/api/v1/prechecks/json \
  -H "X-API-Key: $ARCNM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "cad_file_b64": "string",
    "cad_filename": "bracket.step"
  }'
```

```python title="Python"
import requests

resp = requests.post(
    "https://api.arcnm.io/api/v1/prechecks/json",
    headers={"X-API-Key": "YOUR_API_KEY"},
    json={
        "cad_file_b64": "string",
        "cad_filename": "bracket.step"
    },
)
resp.raise_for_status()
print(resp.json())
```

```typescript title="TypeScript"
const resp = await fetch("https://api.arcnm.io/api/v1/prechecks/json", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.ARCNM_API_KEY!,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "cad_file_b64": "string",
    "cad_filename": "bracket.step"
  }),
})
const data = await resp.json()
```

</CodeTabs>

**Responses**

| Status | Description |
| --- | --- |
| `202` | Successful Response |
| `422` | Validation Error |
| `default` | Error — the error envelope; branch on `error.code`. |

**Errors**

Standard error responses — see the [Errors catalog](../errors.md) for the full envelope, `request_id`, and retry-safety table.

| Status | Code | When |
| --- | --- | --- |
| `401` | `invalid_api_key` | Missing, malformed, or revoked API key. |
| `403` | `insufficient_scope` | The key is valid but lacks a scope this endpoint requires. |
| `409` | `conflict` | A conflicting change, or an `Idempotency-Key` reused with a different body. |
| `429` | `rate_limited` | Per-key or per-org rate limit exceeded — back off with jitter and retry. |


**Response body** `202`

| Field | Type | Description |
| --- | --- | --- |
| `batch_id` | string |  |
| `drawings` | PrecheckDrawingOut[] | Every drawing it holds, in the order they were added. |
| `error_code` | `budget` \| `unreadable` \| `too_complex` \| `internal` |  |
| `expires_at` | string |  |
| `filename` | string |  |
| `id` | string |  |
| `kind` | `assembly` \| `part` \| `unknown` | `assembly`: it splits into parts. `part`: one calculation. `unknown`: not answered. |
| `nodes` | AssemblyBomNodeOut[] |  |
| `per_part` | boolean | Deprecated: always true. Each different made part of an assembly is one calculation; an assembly is never priced as one calculation for all its parts. |
| `position` | integer |  |
| `quota` | PrecheckQuotaOut |  |
| `revision` | string | Send it with the start: a precheck that changed since answers 409. |
| `rows` | PrecheckRowOut[] | The bill of materials, in position order. |
| `sha256` | string | The server's SHA-256 of the stored file, hex. |
| `size_bytes` | integer |  |
| `skipped_files` | SkippedUploadFile[] | Drawings this call sent that do not open, left out with their reason; the others were taken. Null when every file was taken. |
| `stage` | `queued` \| `reading` \| `drawings` |  |
| `started_calculation_id` | string |  |
| `status` | `received` \| `ready` \| `degraded` \| `failed` \| `started` \| `expired` | `received`: reading. `ready`: answered. `degraded` / `failed`: no answer (`error_code`) — starting still works. `started`: a calculation was created from it. `expired`: never started; its files are gone. |
| `totals` | PrecheckTotalsOut |  |

**Example response**

```json
{
  "batch_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "drawings": [
    {
      "basis": "string",
      "component_key": "string",
      "data_source_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "drawing_number": "string",
      "filename": "bracket.step",
      "material": "string",
      "sha256": "9f86d081884c7d659a2feaa0c55ad015…",
      "status": "pending"
    }
  ],
  "error_code": "budget",
  "expires_at": "2026-06-01T12:00:00Z",
  "filename": "bracket.step",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "kind": "assembly",
  "nodes": [
    {
      "components_cost_per_instance": 0,
      "instances": 0,
      "instances_per_parent": 0,
      "name": "string",
      "node_id": "string",
      "own_cost_per_instance": 0,
      "own_time_s_per_instance": 0,
      "parent_id": "string",
      "path": [
        "string"
      ],
      "priced_complete": true,
      "subtotal": 0,
      "subtotal_per_instance": 0
    }
  ],
  "per_part": true,
  "position": 0,
  "quota": {
    "overage_allowed": true,
    "overage_cents_each": 0,
    "remaining_after": 0,
    "remaining_before": 0
  },
  "revision": "string",
  "rows": [
    {
      "assembly_path": [
        "string"
      ],
      "component_key": "string",
      "designation": "string",
      "drawing": {
        "basis": "string",
        "data_source_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "drawing_number": "string",
        "filename": "bracket.step",
        "material": "string",
        "title": "string"
      },
      "drawing_number": "string",
      "fate": "catalogue",
      "held_reason": "wallet_empty",
      "label": "string",
      "named_material": {
        "source": "drawing",
        "text": "string"
      },
      "part_number": "BRACKET-001",
      "part_number_source": "drawing_part_number",
      "placements": [
        {}
      ],
      "position": 0,
      "procurement": {
        "basis": "string",
        "category": "string",
        "decision": "make",
        "kind": "string",
        "match": "string",
        "nominal_m": 0,
        "standard": "string"
      },
      "product_id": "string",
      "purchased_assembly": {
        "n_parts": 0
      },
      "qty_per": 0,
      "sourcing": "make",
      "statement": {
        "excluded": true,
        "inherited": false,
        "material_display_code": "string",
        "material_grade_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "purchased": true,
        "purchased_unit_price": 0
      }
    }
  ],
  "sha256": "9f86d081884c7d659a2feaa0c55ad015…",
  "size_bytes": 204800,
  "skipped_files": [
    {
      "code": "string",
      "filename": "bracket.step"
    }
  ],
  "stage": "queued",
  "started_calculation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "received",
  "totals": {
    "capped": 0,
    "catalogue": 0,
    "dispatched": 0,
    "excluded": 0,
    "free": 0,
    "held": 0,
    "included": 0,
    "made": 0,
    "metered_max": 0,
    "overage": 0,
    "overage_cents": 0,
    "pieces": 0,
    "rows": 0
  }
}
```

## Precheck a file your organization already holds, by its SHA-256

`POST /api/v1/prechecks/probe`

When your organization holds a file with this SHA-256 — dropped or
calculated before — the precheck starts from it without an upload;
otherwise `upload_required` is true and nothing is created.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Prefer` | header | string | no |  |

**Request body** (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `batch_id` | string | no |  |
| `filename` | string | yes |  |
| `part_number` | string | no | The part number it will be started under. |
| `position` | integer | no |  |
| `sha256` | string | yes | SHA-256 of the file, hex. |
| `size_bytes` | integer | yes |  |

**Request**

<CodeTabs>

```bash title="cURL"
curl -X POST https://api.arcnm.io/api/v1/prechecks/probe \
  -H "X-API-Key: $ARCNM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sha256": "9f86d081884c7d659a2feaa0c55ad015…",
    "filename": "bracket.step",
    "size_bytes": 204800
  }'
```

```python title="Python"
import requests

resp = requests.post(
    "https://api.arcnm.io/api/v1/prechecks/probe",
    headers={"X-API-Key": "YOUR_API_KEY"},
    json={
        "sha256": "9f86d081884c7d659a2feaa0c55ad015…",
        "filename": "bracket.step",
        "size_bytes": 204800
    },
)
resp.raise_for_status()
print(resp.json())
```

```typescript title="TypeScript"
const resp = await fetch("https://api.arcnm.io/api/v1/prechecks/probe", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.ARCNM_API_KEY!,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "sha256": "9f86d081884c7d659a2feaa0c55ad015…",
    "filename": "bracket.step",
    "size_bytes": 204800
  }),
})
const data = await resp.json()
```

</CodeTabs>

**Responses**

| Status | Description |
| --- | --- |
| `200` | Successful Response |
| `422` | Validation Error |
| `default` | Error — the error envelope; branch on `error.code`. |

**Errors**

Standard error responses — see the [Errors catalog](../errors.md) for the full envelope, `request_id`, and retry-safety table.

| Status | Code | When |
| --- | --- | --- |
| `401` | `invalid_api_key` | Missing, malformed, or revoked API key. |
| `403` | `insufficient_scope` | The key is valid but lacks a scope this endpoint requires. |
| `409` | `conflict` | A conflicting change, or an `Idempotency-Key` reused with a different body. |
| `429` | `rate_limited` | Per-key or per-org rate limit exceeded — back off with jitter and retry. |


**Response body** `200`

| Field | Type | Description |
| --- | --- | --- |
| `precheck` | PrecheckOut |  |
| `upload_required` | boolean | True: send the file (`POST /prechecks`). False: `precheck` is it. |

**Example response**

```json
{
  "precheck": {
    "batch_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "drawings": [
      {
        "basis": "string",
        "component_key": "string",
        "data_source_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "drawing_number": "string",
        "filename": "bracket.step",
        "material": "string",
        "sha256": "9f86d081884c7d659a2feaa0c55ad015…",
        "status": "pending"
      }
    ],
    "error_code": "budget",
    "expires_at": "2026-06-01T12:00:00Z",
    "filename": "bracket.step",
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "kind": "assembly",
    "nodes": [
      {
        "components_cost_per_instance": 0,
        "instances": 0,
        "instances_per_parent": 0,
        "name": "string",
        "node_id": "string",
        "own_cost_per_instance": 0,
        "own_time_s_per_instance": 0,
        "parent_id": "string",
        "path": [],
        "priced_complete": true,
        "subtotal": 0,
        "subtotal_per_instance": 0
      }
    ],
    "per_part": true,
    "position": 0,
    "quota": {
      "overage_allowed": true,
      "overage_cents_each": 0,
      "remaining_after": 0,
      "remaining_before": 0
    },
    "revision": "string",
    "rows": [
      {
        "assembly_path": [],
        "component_key": "string",
        "designation": "string",
        "drawing": {},
        "drawing_number": "string",
        "fate": "catalogue",
        "held_reason": "wallet_empty",
        "label": "string",
        "named_material": {},
        "part_number": "BRACKET-001",
        "part_number_source": "drawing_part_number",
        "placements": [],
        "position": 0,
        "procurement": {},
        "product_id": "string",
        "purchased_assembly": {},
        "qty_per": 0,
        "sourcing": "make",
        "statement": {}
      }
    ],
    "sha256": "9f86d081884c7d659a2feaa0c55ad015…",
    "size_bytes": 204800,
    "skipped_files": [
      {
        "code": "string",
        "filename": "bracket.step"
      }
    ],
    "stage": "queued",
    "started_calculation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "status": "received",
    "totals": {
      "capped": 0,
      "catalogue": 0,
      "dispatched": 0,
      "excluded": 0,
      "free": 0,
      "held": 0,
      "included": 0,
      "made": 0,
      "metered_max": 0,
      "overage": 0,
      "overage_cents": 0,
      "pieces": 0,
      "rows": 0
    }
  },
  "upload_required": true
}
```
