Skip to main content
POST
/
computes
Create a compute instance
curl --request POST \
  --url https://api.strettch.cloud/api/v1/computes \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --data '
{
  "hostName": "my-server-01",
  "image": "UBUNTU-24.04",
  "publicKeys": [
    "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8Z5mS1x7I6n... user@host"
  ],
  "region": "KGL-1",
  "specification": "S-1C-1G",
  "tags": [
    "production",
    "web"
  ],
  "withPublicIp": true
}
'
{
  "message": "Operation successful",
  "requestId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "success": true,
  "timestamp": "2024-01-15T10:00:00Z",
  "data": {
    "id": "325",
    "hostName": "my-server-01",
    "state": "RUNNING",
    "image": "UBUNTU-24.04",
    "specification": "S-1C-1G",
    "region": "KGL-1",
    "ipv4": "195.15.0.73",
    "privateIpv4": "10.0.0.5",
    "tags": [
      "production",
      "web"
    ],
    "createdAt": "2024-01-15T10:00:00Z",
    "updatedAt": "2024-01-15T10:05:00Z"
  }
}

Request Reference

Use these slugs for the region, image, and specification fields in your request body.
SlugNameCountry
KGL-1Kigali-1🇷🇼 Rwanda

Response Error Codes

If the request fails, the code field in the error response will contain one of the following.
CodeStatusDescription
BAD_REQUEST400The request was invalid or malformed.
UNAUTHORIZED401Authentication failed or was not provided.
FORBIDDEN403You do not have permission to perform this action.
RESOURCE_NOT_FOUND404The requested resource (image, region, or specification) was not found.
CONFLICT409A conflict with the current server state occurred.
UNPROCESSABLE_ENTITY422The request was well-formed but failed semantic validation.
TOO_MANY_REQUESTS429You have exceeded the rate limit.
INTERNAL_SERVER_ERROR500An unexpected error occurred on our end.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Idempotency-Key
string
required

Idempotency key (UUID v4)

Body

application/json
hostName
string
required
Example:

"my-server-01"

image
string
required
Example:

"UBUNTU-24.04"

publicKeys
string[]
required
Minimum array length: 1
Example:
[
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8Z5mS1x7I6n... user@host"
]
region
string
required
Example:

"KGL-1"

specification
string
required

e.g. S-1C-1G or S-1C

Example:

"S-1C-1G"

tags
string[]
Example:
["production", "web"]
withPublicIp
boolean
Example:

true

Response

Accepted

message
string
Example:

"Operation successful"

requestId
string
Example:

"f47ac10b-58cc-4372-a567-0e02b2c3d479"

success
boolean
Example:

true

timestamp
string
Example:

"2024-01-15T10:00:00Z"

data
object