---
title: "List machine templates"
method: GET
path: "/api/v0/machines/templates"
tags: ["Machine Templates"]
deprecated: true
---

# List machine templates

`GET /api/v0/machines/templates`

## Request

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

> **Deprecated.**

Deprecated: use Environments (`/api/v0/environments`) instead. Returns every machine template the caller can access in the authenticated organization, in one response: pagination.hasMore is always false and pagination.nextCursor is always null.

## Headers

- `X-Factory-Org-Id` string

## Response `200`

Response for status 200

- ListMachineTemplates200ResponseBody
  - `templates` object[], required
    - `templateId` string, required: Template ID
    - `repoUrl` union, required: Repository URL
      - string, uri
      - ''
    - `templateName` string, required: Human-readable template name
    - `defaultBranch` string, required: Default branch name
    - `createdBy` string, required: User ID of creator
    - `createdAt` integer: Creation timestamp (ms)
    - `buildStatus` object: Build status
      - `status` 'building' | 'success' | 'failed', required: Current build status
      - `failureReason` 'setup_script_error' | 'system_error': Reason for build failure (only present when status is failed)
      - `buildStartedAt` integer: Build start timestamp (ms)
      - `builtAt` integer: Build completion timestamp (ms)
      - `logs` string: Build logs
    - `lastUpdatedAt` integer, nullable: Last update timestamp (ms)
    - `environmentVariables` object[]: Shared environment variables
      - `key` string, required: Environment variable name
      - `value` string, required: Environment variable value
    - `userEnvironmentVariablesByUser` object[]: User-specific environment variables
      - `key` string, required: Environment variable name
      - `value` string, required: Environment variable value
    - `setupScript` string: Setup script to run after cloning
  - `pagination` object, required
    - `hasMore` boolean, required: Whether there are more items after this page
    - `nextCursor` string, nullable, required: Cursor to use for the next page, null if no more pages

## 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`: 3 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `404`
  - 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`: 3 breaking, 4 warning, 10 info
  - for the `query` request parameter `limit`, default value `20` was added
  - the response property `templates/items/createdAt` became optional for the status `200`
  - removed the required property `templates/items/id` from the response with the `200` status
  - removed the optional property `pagination/total` from the response with the `200` status
  - …13 more

[Operation history](https://skmtc.dev/factory/apis/factory-public-api/changes/api/v0/machines/templates/get.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)
