Skip to main content
POST
/
v2
/
images
Create image
curl --request POST \
  --url https://api.sfcompute.com/v2/images \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "workspace": "<string>",
  "name": "my-resource-name"
}
'
{
  "id": "<string>",
  "resource_path": "<string>",
  "owner": "<string>",
  "workspace": "<string>",
  "name": "<string>",
  "object": "image",
  "upload_status": "started",
  "created_at": 1738972800,
  "sha256": "<string>"
}

Authorizations

Authorization
string
header
required

Create an API token using sf tokens create or at https://sfcompute.com/account/api-keys.

Body

application/json

Start a multipart image upload. Max image size is 128 GiB.

workspace
string
required

Workspace to create this image in.

Pattern: (wksp_[0-9a-zA-Z_-]{1,21})|(sfc:workspace:[a-zA-Z0-9._-]+(:[a-zA-Z0-9._-]+){1,3})
Example:

"wksp_k3R-nX9vLm7Qp2Yw5Jd8F"

name
null | string
Required string length: 1 - 255
Pattern: [a-zA-Z0-9][a-zA-Z0-9._-]{0,254}
Example:

"my-resource-name"

Response

Image created

id
string
required
Pattern: image_[0-9a-zA-Z_-]{1,21}
Example:

"image_k3R-nX9vLm7Qp2Yw5Jd8F"

resource_path
string
required

A resource path for a image resource. Format: sfc:image:::.

Pattern: sfc:image:([a-zA-Z0-9._-]+:){2}[a-zA-Z0-9._-]+
Example:

"sfc:image:<account_id>:<workspace>:<name>"

owner
string
required
Required string length: 1 - 255
Pattern: [a-zA-Z0-9][a-zA-Z0-9._-]{0,254}
Example:

"my-resource-name"

workspace
string
required
Required string length: 1 - 255
Pattern: [a-zA-Z0-9][a-zA-Z0-9._-]{0,254}
Example:

"my-resource-name"

name
string
required
Required string length: 1 - 255
Pattern: [a-zA-Z0-9][a-zA-Z0-9._-]{0,254}
Example:

"my-resource-name"

object
string
default:image
required
read-only
Allowed value: "image"
upload_status
enum<string>
required
Available options:
started,
uploading,
completed,
failed
created_at
integer<int64>
required

Unix timestamp.

Example:

1738972800

sha256
string | null
Required string length: 64
Pattern: ^[a-f0-9]{64}$