API v1 preview

# Update a model

`PATCH /api/v1/models/{model_id}`

## Overview

Rename or resize a model. Send the ETag from Get Model in If-Match; a stale value returns 412 precondition_failed, and without If-Match the last write wins. A size change clears checks and prices and inspects the model again. A failed model can retry without a new upload. Existing orders are unchanged. PATCH has no idempotent replay.

Requires `models:write`.

[Model edits and revisions guide](https://ottomfg.com/docs/edit-models.md)

[Errors and retries](https://ottomfg.com/docs/errors.md)

Request

bash

```
# Requires models:write. GET the model with models:read and save its ETag header.
# Save only the intended name/size changes in model-update.json.
: "${MODEL_ETAG:?Set the saved ETag, including its quotes}"
curl --fail-with-body --max-time 30 --request PATCH \
  "${API_BASE_URL%/}/api/v1/models/$MODEL_ID" \
  --header "Authorization: Bearer $OTTOMFG_API_KEY" \
  --header "If-Match: $MODEL_ETAG" \
  --header "Content-Type: application/json" \
  --data-binary @model-update.json
# On 412 precondition_failed, GET and compare before preparing another edit.
# After a timeout, read the model to reconcile; never refresh If-Match blindly.
```

Set API_BASE_URL, OTTOMFG_API_KEY and MODEL_ID. Save the write body and GET ETag as MODEL_ETAG for If-Match. The replacement example also uses REVISION_REQUEST_KEY for retries. See the guide before sending. History reads need no body or key.

**More request examples**

Request body

```
{
  "name": "Wedding figurine"
}
```

[Edit setup and recovery](https://ottomfg.com/docs/edit-models.md)

## Parameters

`model_id` path · required

Immutable model ID: MD- followed by eight uppercase Crockford Base32 characters. Use this same ID in the website, URLs and API; pass it unchanged.

string

`If-Match` header · optional

ETag from GetModel. The edit applies only while that version is current; otherwise 412 precondition_failed. Omit for last-write-wins.

string

## Request body

application/json

`name` string · conditional

Nonblank model name. Trimmed; control and format characters rejected.

Min length: 1 · Max length: 255

`longest_dimension_mm` number · conditional

Longest bounding-box dimension in millimeters, 30–200 inclusive. Fractional values are accepted. Uniformly scale all axes. At model creation this is the default and inspection reference size; each pricing/quote item explicitly selects its own size. Callers convert other units to millimeters.

Minimum: 30 · Maximum: 200

## Responses

Updated model.

200 response

JSON

```
{
  "id": "MD-739YQ549",
  "file_revision": 1,
  "source": {
    "file_id": "file_6c82bd3e319b4bb099310d54a761879e"
  },
  "name": "Wedding figurine",
  "created_at": "2026-09-18T18:00:00.000000Z",
  "updated_at": "2026-09-30T00:01:00.000000Z",
  "status": "processing",
  "status_reasons": [
    {
      "code": "inspection_pending",
      "message": "Mesh inspection is running."
    }
  ],
  "preview": {
    "status": "pending"
  },
  "longest_dimension_mm": 100,
  "mesh_check": {
    "status": "pending"
  },
  "print_check": {
    "status": "pending"
  },
  "repair": {
    "required": false,
    "applied": false,
    "reason": null,
    "status": "not_applied",
    "fee": 0,
    "covered_by_order_id": null
  },
  "progress": {
    "stage": "queued"
  },
  "volume": null,
  "estimated_weight_g": null
}
```

Returns [the Model object](https://ottomfg.com/docs/model-object.md).

**Response headers**

`X-Request-ID`

Request identifier for support. Send X-Request-ID with 8–64 ASCII letters, digits or hyphens to reuse that value; otherwise the server generates a UUID4 hex value. Include the returned X-Request-ID in support requests. Do not put secrets or account IDs in this value.

`ETag`

Opaque model edit version. Changes only when the file, name or print size changes; processing and previews do not invalidate it. Send the complete quoted value in If-Match.

## Errors

| HTTP | Code | What to do |
| --- | --- | --- |
| 400 Bad Request | `invalid_argument` | A field, query parameter or header is invalid. Fix the field named in details, then send the request again. |
| 401 Unauthorized | `unauthenticated` | The API key is missing, invalid or revoked. Send a valid business API key in Authorization: Bearer. |
| 403 Forbidden | `permission_denied` | The key lacks the endpoint's scope, or payments lack spending consent. Check the scope listed on the endpoint. |
| 404 Not Found | `model_not_found` | No model with this ID exists in the account, or it was deleted. Check the ID. |
| 409 Conflict | `model_not_ready` | The model is still processing. Wait until its status is ready, then retry. |
| 412 Precondition Failed | `precondition_failed` | The model changed since you read its ETag. Read it again, review the change, then retry with the new ETag in If-Match. |
| 413 Content Too Large | `request_too_large` | The JSON body is over this endpoint's size limit. Send a smaller body. |
| 415 Unsupported Media Type | `unsupported_media_type` | The body is not JSON. Send Content-Type: application/json. |
| 429 Too Many Requests | `resource_exhausted` | A rate or account limit was reached. Wait at least Retry-After seconds, then retry. |
| 500 Internal Server Error | `internal` | The server failed unexpectedly. Retry with backoff; contact support with X-Request-ID if it persists. |
| 503 Service Unavailable | `unavailable` | A required service is briefly unavailable. Retry with backoff, reusing the same Idempotency-Key. |

[Idempotent requests](https://ottomfg.com/docs/idempotency.md)

API v1 preview

Source: https://ottomfg.com/docs/update-model
