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

# Get a machine template

`GET /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. Returns details of a specific machine template. Returns 409 when the organization requires personal GitLab Self-Hosted connections and the GitLab project behind the template was renamed or moved since repositories were last synced; an admin must sync repositories before the request can succeed.

## Path parameters

- `templateId` string, required: Template ID

## Headers

- `X-Factory-Org-Id` string

## Response `200`

Response for status 200

- GetMachineTemplate200ResponseBody
  - `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

## 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
- `409`: Response for status 409
- `451`: Response for status 451
- `500`: Response for status 500
- `503`: Response for status 503

## Changes

- **2026-11-12** `b6a46c415079`: 1 info
  - endpoint added
- **2026-07-13** `09c8ece419bf`: 1 breaking
  - api path removed without deprecation
- **2026-02-19** `a2635efd0dae`: 7 breaking, 5 warning, 7 info
  - the response property `buildStatus` became optional for the status `200`
  - the response property `createdAt` became optional for the status `200`
  - the response property `lastUpdatedAt` became optional for the status `200`
  - the `repoUrl` response's property type changed from `string` to no type, and format from `uri` to no format for status `200`
  - …15 more

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