Skip to content
Raster
Esc
navigateopen⌘Jpreview

create a template

With source_machine_id the machine’s disk is captured and the template is returned in building. With neither a source machine nor a snapshot the template is just a named image and size, and is ready immediately.

POST/v1/templates
Authorization
AuthorizationBearer token · headerrequired
an organization api key. browser clients use the session cookie instead.
or
computer_sessionAPI key · cookierequired
first-party httponly browser session; never readable from javascript.
Header parameters
idempotency-keystring
min length 1 · max length 255
Request body
requiredapplication/json
namestringrequired
min length 1 · max length 63 · matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?$
descriptionstring
max length 1024
osMachineOs
Allowed:linux
sizeMachineSize
Allowed:smallstandardlarge
image_idstring
machine image identifier
matches ^img_[0-9a-z]{20,32}$
source_machine_idstring
machine identifier
matches ^mch_[0-9a-z]{20,32}$
snapshot_idstring
snapshot identifier
matches ^snp_[0-9a-z]{20,32}$
metadataobject
caller-defined key/value pairs, echoed back unchanged
Responses
201OK
idstringrequired
template identifier
matches ^tpl_[0-9a-z]{20,32}$
organization_idstringrequired
organization identifier
matches ^org_[0-9a-z]{20,32}$
namestringrequired
min length 1 · max length 63 · matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?$
descriptionstring | anyrequired
Show properties
Any of:
string
string
any
any
stateTemplateStaterequired
Allowed:buildingreadyerror
osMachineOsrequired
Allowed:linux
sizeMachineSizerequired
Allowed:smallstandardlarge
image_idstringrequired
machine image identifier
matches ^img_[0-9a-z]{20,32}$
publishedbooleanrequired
provisionTemplateProvision | anyrequired
Show properties
Any of:
TemplateProvision
filesTemplateProvisionFile[]
max items 32 · default: []
Show properties
Array of TemplateProvisionFile
pathstringrequired
min length 2 · max length 4096 · matches ^\/[^\0]+$
contentstringrequired
max length 65536
setupstringrequired
min length 1 · max length 65536
any
any
snapshot_idstring | anyrequired
Show properties
Any of:
string
string
any
any
source_machine_idstring | anyrequired
Show properties
Any of:
string
string
any
any
size_bytesinteger | anyrequired
Show properties
Any of:
integer
integer
any
any
errorstring | anyrequired
Show properties
Any of:
string
string
any
any
metadataobjectrequired
caller-defined key/value pairs, echoed back unchanged
created_atstring<date-time>required
updated_atstring<date-time>required
400invalid request
errorobjectrequired
Show properties
codeErrorCoderequired
Allowed:invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailable
messagestringrequired
human-readable, not machine-parseable
request_idstringrequired
detailsFieldError[]
Show properties
Array of FieldError
fieldstringrequired
dotted path into the request body
messagestringrequired
quotaobject
Show properties
limitstringrequired
the entitlement that declined this request
currentintegerrequired
min 0 · max 9007199254740991
maximuminteger | anyrequired
Show properties
Any of:
integer
integer
any
any
plan_idstringrequired
upgrade_urlstring | anyrequired
Show properties
Any of:
string
string
any
any
401unauthenticated
errorobjectrequired
Show properties
codeErrorCoderequired
Allowed:invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailable
messagestringrequired
human-readable, not machine-parseable
request_idstringrequired
detailsFieldError[]
Show properties
Array of FieldError
fieldstringrequired
dotted path into the request body
messagestringrequired
quotaobject
Show properties
limitstringrequired
the entitlement that declined this request
currentintegerrequired
min 0 · max 9007199254740991
maximuminteger | anyrequired
Show properties
Any of:
integer
integer
any
any
plan_idstringrequired
upgrade_urlstring | anyrequired
Show properties
Any of:
string
string
any
any
402quota exceeded
errorobjectrequired
Show properties
codeErrorCoderequired
Allowed:invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailable
messagestringrequired
human-readable, not machine-parseable
request_idstringrequired
detailsFieldError[]
Show properties
Array of FieldError
fieldstringrequired
dotted path into the request body
messagestringrequired
quotaobject
Show properties
limitstringrequired
the entitlement that declined this request
currentintegerrequired
min 0 · max 9007199254740991
maximuminteger | anyrequired
Show properties
Any of:
integer
integer
any
any
plan_idstringrequired
upgrade_urlstring | anyrequired
Show properties
Any of:
string
string
any
any
403permission denied
errorobjectrequired
Show properties
codeErrorCoderequired
Allowed:invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailable
messagestringrequired
human-readable, not machine-parseable
request_idstringrequired
detailsFieldError[]
Show properties
Array of FieldError
fieldstringrequired
dotted path into the request body
messagestringrequired
quotaobject
Show properties
limitstringrequired
the entitlement that declined this request
currentintegerrequired
min 0 · max 9007199254740991
maximuminteger | anyrequired
Show properties
Any of:
integer
integer
any
any
plan_idstringrequired
upgrade_urlstring | anyrequired
Show properties
Any of:
string
string
any
any
404not found
errorobjectrequired
Show properties
codeErrorCoderequired
Allowed:invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailable
messagestringrequired
human-readable, not machine-parseable
request_idstringrequired
detailsFieldError[]
Show properties
Array of FieldError
fieldstringrequired
dotted path into the request body
messagestringrequired
quotaobject
Show properties
limitstringrequired
the entitlement that declined this request
currentintegerrequired
min 0 · max 9007199254740991
maximuminteger | anyrequired
Show properties
Any of:
integer
integer
any
any
plan_idstringrequired
upgrade_urlstring | anyrequired
Show properties
Any of:
string
string
any
any
409conflict with current state
errorobjectrequired
Show properties
codeErrorCoderequired
Allowed:invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailable
messagestringrequired
human-readable, not machine-parseable
request_idstringrequired
detailsFieldError[]
Show properties
Array of FieldError
fieldstringrequired
dotted path into the request body
messagestringrequired
quotaobject
Show properties
limitstringrequired
the entitlement that declined this request
currentintegerrequired
min 0 · max 9007199254740991
maximuminteger | anyrequired
Show properties
Any of:
integer
integer
any
any
plan_idstringrequired
upgrade_urlstring | anyrequired
Show properties
Any of:
string
string
any
any
412precondition failed
errorobjectrequired
Show properties
codeErrorCoderequired
Allowed:invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailable
messagestringrequired
human-readable, not machine-parseable
request_idstringrequired
detailsFieldError[]
Show properties
Array of FieldError
fieldstringrequired
dotted path into the request body
messagestringrequired
quotaobject
Show properties
limitstringrequired
the entitlement that declined this request
currentintegerrequired
min 0 · max 9007199254740991
maximuminteger | anyrequired
Show properties
Any of:
integer
integer
any
any
plan_idstringrequired
upgrade_urlstring | anyrequired
Show properties
Any of:
string
string
any
any
429rate limited
errorobjectrequired
Show properties
codeErrorCoderequired
Allowed:invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailable
messagestringrequired
human-readable, not machine-parseable
request_idstringrequired
detailsFieldError[]
Show properties
Array of FieldError
fieldstringrequired
dotted path into the request body
messagestringrequired
quotaobject
Show properties
limitstringrequired
the entitlement that declined this request
currentintegerrequired
min 0 · max 9007199254740991
maximuminteger | anyrequired
Show properties
Any of:
integer
integer
any
any
plan_idstringrequired
upgrade_urlstring | anyrequired
Show properties
Any of:
string
string
any
any
500internal error
errorobjectrequired
Show properties
codeErrorCoderequired
Allowed:invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailable
messagestringrequired
human-readable, not machine-parseable
request_idstringrequired
detailsFieldError[]
Show properties
Array of FieldError
fieldstringrequired
dotted path into the request body
messagestringrequired
quotaobject
Show properties
limitstringrequired
the entitlement that declined this request
currentintegerrequired
min 0 · max 9007199254740991
maximuminteger | anyrequired
Show properties
Any of:
integer
integer
any
any
plan_idstringrequired
upgrade_urlstring | anyrequired
Show properties
Any of:
string
string
any
any
501unsupported operation
errorobjectrequired
Show properties
codeErrorCoderequired
Allowed:invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailable
messagestringrequired
human-readable, not machine-parseable
request_idstringrequired
detailsFieldError[]
Show properties
Array of FieldError
fieldstringrequired
dotted path into the request body
messagestringrequired
quotaobject
Show properties
limitstringrequired
the entitlement that declined this request
currentintegerrequired
min 0 · max 9007199254740991
maximuminteger | anyrequired
Show properties
Any of:
integer
integer
any
any
plan_idstringrequired
upgrade_urlstring | anyrequired
Show properties
Any of:
string
string
any
any
503compute unavailable
errorobjectrequired
Show properties
codeErrorCoderequired
Allowed:invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailable
messagestringrequired
human-readable, not machine-parseable
request_idstringrequired
detailsFieldError[]
Show properties
Array of FieldError
fieldstringrequired
dotted path into the request body
messagestringrequired
quotaobject
Show properties
limitstringrequired
the entitlement that declined this request
currentintegerrequired
min 0 · max 9007199254740991
maximuminteger | anyrequired
Show properties
Any of:
integer
integer
any
any
plan_idstringrequired
upgrade_urlstring | anyrequired
Show properties
Any of:
string
string
any
any
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST "https://api.raster.sh/v1/v1/templates" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "research-box",
  "description": "string",
  "os": "linux",
  "size": "small",
  "image_id": "img_01h8xk2q4v9m3n7p5r0t",
  "source_machine_id": "mch_01h8xk2q4v9m3n7p5r0t",
  "snapshot_id": "snp_01h8xk2q4v9m3n7p5r0t",
  "metadata": {
    "property1": "string",
    "property2": "string"
  }
}'
Response
{
  "id": "tpl_01h8xk2q4v9m3n7p5r0t",
  "organization_id": "org_01h8xk2q4v9m3n7p5r0t",
  "name": "research-box",
  "description": "string",
  "state": "building",
  "os": "linux",
  "size": "small",
  "image_id": "img_01h8xk2q4v9m3n7p5r0t",
  "published": true,
  "provision": {
    "files": [],
    "setup": "string"
  },
  "snapshot_id": "snp_01h8xk2q4v9m3n7p5r0t",
  "source_machine_id": "mch_01h8xk2q4v9m3n7p5r0t",
  "size_bytes": 9007199254740991,
  "error": "string",
  "metadata": {
    "property1": "string",
    "property2": "string"
  },
  "created_at": "2026-08-19T12:00:00Z",
  "updated_at": "2026-08-19T12:00:00Z"
}