Skip to main content
POST
/
api
/
v0
/
machines
/
templates
Create a machine template
curl --request POST \
  --url https://api.factory.ai/api/v0/machines/templates \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "repoUrl": "<string>",
  "name": "<string>",
  "environmentVariables": [
    {
      "key": "<string>",
      "value": "<string>"
    }
  ],
  "setupScript": "<string>"
}
'
{
  "id": "<string>",
  "createdAt": 123
}

Authorizations

X-API-Key
string
header
required

Factory API key for authentication

Body

application/json
repoUrl
string<uri>
required

Repository URL to clone

name
string
required

Human-readable template name

Required string length: 1 - 100
environmentVariables
object[]

Environment variables to set in the machine

setupScript
string

Setup script to run after cloning

Maximum string length: 10000

Response

Response for status 201

id
string
required

Unique template identifier

createdAt
integer
required

Unix timestamp (ms)