---
title: "Delete a machine template"
method: DELETE
path: "/api/v0/machines/templates/{templateId}"
tags: ["Machine Templates"]
deprecated: true
---

# Delete a machine template

`DELETE /api/v0/machines/templates/{templateId}`

## Request

- Base URL: `https://api.factory.ai`
- URL: `https://api.factory.ai/api/v0/machines/templates/{templateId}`
- Auth: HTTP bearer

> **Deprecated.**

Deprecated: use Environments (`/api/v0/environments`) instead. Deletes a machine template: revokes its API keys and marks the template deleted, after which GET and PATCH return 400. Requires the Manager or Owner role or being the template creator. The built-in empty template cannot be deleted.

## Path parameters

- `templateId` string, required: Template ID

## Headers

- `X-Factory-Org-Id` string

## Response `204`

Response for status 204

## Other responses

- `400`: Response for status 400
- `401`: Response for status 401
- `402`: Response for status 402
- `403`: Response for status 403
- `404`: Response for status 404
- `451`: Response for status 451
- `500`: Response for status 500
- `503`: Response for status 503

## Changes

- **2026-11-14** `9fb2e1b1ec61`: 1 info
  - added the non-success response with the status `503`
- **2026-11-12** `b6a46c415079`: 1 info
  - endpoint added
- **2026-07-13** `09c8ece419bf`: 1 breaking
  - api path removed without deprecation
- **2026-02-19** `a2635efd0dae`: 4 warning
  - removed the optional property `requestId` from the response with the `401` status
  - removed the optional property `requestId` from the response with the `403` status
  - removed the optional property `requestId` from the response with the `404` status
  - removed the optional property `requestId` from the response with the `500` status

[Operation history](https://skmtc.dev/factory/apis/factory-public-api/changes/api/v0/machines/templates/:templateId/delete.md)

---

[API](https://skmtc.dev/factory/apis/factory-public-api.md) - [All operations](https://skmtc.dev/factory/apis/factory-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/factory/apis/factory-public-api/revisions/2e37e1b079d2?raw)
