Skip to main content

Create Share

POST /v1/shares

Expose a port of your VM at an HTTPS URL, returned as url. Pass vm_id, or session_id to use that session's current VM; the VM must be active, and the share only works while it stays active. A private share (is_public false, the default) answers only requests that carry your own API key or bearer token; a public share is open to anyone with the URL.

Authentication​

Requires authentication via: OAuth2PasswordBearer.

Parameters​

NameInTypeRequiredDescriptionConstraints
X-API-Keyheaderstring | nullNonullable

Request Body​

Required: Yes

application/json​

Resolved schema:

{
"properties": {
"session_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Session Id"
},
"vm_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Vm Id"
},
"port": {
"type": "integer",
"maximum": 65535,
"minimum": 1,
"title": "Port"
},
"is_public": {
"type": "boolean",
"title": "Is Public",
"default": false
}
},
"type": "object",
"required": [
"port"
],
"title": "ShareCreateRequest"
}

Field details:

FieldTypeRequiredDescriptionConstraints
session_idstring | nullNonullable
vm_idstring | nullNonullable
portintegerYesmin=1, max=65535
is_publicbooleanNodefault=false

Responses​

200​

Successful Response

application/json​

Resolved schema:

{}

400​

Neither session_id nor vm_id was given, session_id is not a valid UUID, the session has no VM, or the VM is not active.

No response body.

401​

No credentials, or the Bearer token / X-API-Key is invalid.

No response body.

403​

The account is disabled, or a guest token was used; or the session or VM belongs to another account.

No response body.

404​

Session or VM not found.

No response body.

422​

Validation Error

application/json​

Resolved schema:

{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}

Field details:

FieldTypeRequiredDescriptionConstraints
detailarray<object>No
detail[]objectNo
detail[].locarray<string | integer>No
detail[].loc[]string | integerNo
detail[].msgstringNo
detail[].typestringNo

429​

Rate limit exceeded. Retry later.

No response body.