API v1 preview

# Delete a model

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

## Overview

Soft-delete a model owned by your account. Returns its ID and deleted: true; subsequent lookup and repeated deletion return 404, and lists exclude it. The linked file remains protected. A model referenced by any order, including a cancelled order, cannot be deleted.

Requires `models:write`.

[Create and poll a model guide](https://ottomfg.com/docs/models.md)

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

Request

```
# Set MODEL_ID to the model you intend to delete. Requires models:write.
curl --fail-with-body --request DELETE \
  "${API_BASE_URL%/}/api/v1/models/$MODEL_ID" \
  --header "Authorization: Bearer $OTTOMFG_API_KEY"
# Success: {"id":"MD-7K3P9D2Q","deleted":true}. Repeated DELETE returns 404.
# A 409 model_in_use means an order references this model; keep the model.
```

Use a key with models:write. Set MODEL_ID to the model you intend to delete; no request body is needed.

[Registration and lookup examples](https://ottomfg.com/docs/models.md)

## Parameters

`model_id` path · required

Public model ID returned in id; pass unchanged.

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

## Responses

Model deleted.

200 response

JSON

```
{
  "id": "MD-739YQ549",
  "deleted": true
}
```

`id` string · 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.

Min length: 11 · Max length: 11

`deleted` boolean · required

Always true.

Always: `true`

**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.

## Errors

| HTTP | Code | What to do |
| --- | --- | --- |
| 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_in_use` | An order uses this model, so it cannot be deleted. |
| 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/delete-model
