Get App Url
GET /v1/sessions/app-url/{session_id}
Get a public URL for a service running inside the VM.
This allows you to expose a web server running inside the VM (e.g., on port 3000) to the outside world via a public URL.
Args: session_id: Your session UUID port: The port your service is running on inside the VM (default: 80)
Returns:
- url: The public URL to access your service
- direct_url: Direct subdomain URL (requires wildcard SSL setup)
- vm_ip: Internal VM IP (for debugging)
- port: The port being exposed
- vm_id: The VM identifier
- status: VM status (active/killed)
- expires_in_seconds: Time until VM is killed
Example: GET /v1/app-url/550e8400-e29b-41d4-a716-446655440000?port=3000
Response: { "url": "https://api.instavm.io/v1/app/550e8400.../3000/", "direct_url": "https://vmid-abc-15-3000.sandbox.instavm.io/", "vm_ip": "172.30.15.2", "port": 3000, "vm_id": "vmid-abc-15", "status": "active", "expires_in_seconds": 245 }
Authentication
Requires authentication via: OAuth2PasswordBearer.
Parameters
| Name | In | Type | Required | Description | Constraints |
|---|---|---|---|---|---|
session_id | path | string | Yes | ||
port | query | integer | No | Port to expose (1-65535) | default=80, min=1, max=65535 |
X-API-Key | header | string | null | No | nullable |
Responses
200
Successful Response
application/json
Resolved schema:
{
"properties": {
"url": {
"type": "string",
"title": "Url"
},
"direct_url": {
"type": "string",
"title": "Direct Url"
},
"vm_ip": {
"type": "string",
"title": "Vm Ip"
},
"port": {
"type": "integer",
"title": "Port"
},
"vm_id": {
"type": "string",
"title": "Vm Id"
},
"session_id": {
"type": "string",
"title": "Session Id"
},
"status": {
"type": "string",
"title": "Status"
},
"expires_in_seconds": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Expires In Seconds"
}
},
"type": "object",
"required": [
"url",
"direct_url",
"vm_ip",
"port",
"vm_id",
"session_id",
"status"
],
"title": "AppURLResponse",
"description": "Response model for app URL generation."
}
Field details:
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
url | string | Yes | ||
direct_url | string | Yes | ||
vm_ip | string | Yes | ||
port | integer | Yes | ||
vm_id | string | Yes | ||
session_id | string | Yes | ||
status | string | Yes | ||
expires_in_seconds | integer | null | No | nullable |
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:
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
detail | array<object> | No | ||
detail[] | object | No | ||
detail[].loc | array<string | integer> | No | ||
detail[].loc[] | string | integer | No | ||
detail[].msg | string | No | ||
detail[].type | string | No |