Skip to content

The Containers API provides endpoints to list, create, retrieve, update, and delete containers. It also exposes container resource statistics and signed authorization claims for offline verification by container programs. Use these endpoints to manage container lifecycles across projects, monitor performance, and issue portable credentials.

GET /api/v1/containers/

Get all containers across all projects for the current user with pagination, filtering, and sorting. This endpoint provides a global view of all containers without being scoped to a specific project.

NameInTypeRequiredDescription
pagequerynumberNoPage number for pagination - starts from 1. Default: 1
limitquerynumberNoNumber of containers to return per page - maximum 100 items. Default: 50
sort_byquerystringNoField to sort containers by. Allowed: id, name, status, created_at, updated_at. Default: "created_at"
sort_orderquerystringNoSort direction - ascending or descending. Allowed: asc, desc. Default: "desc"
realm_idquerystringNoFilter by realm ID. Only returns containers that belong to this realm. Alternative to using realm subdomain in URL.
runtimequerystringNoInclude live runtime information. Accepts "true", "false", or a URL-encoded JSON string like {"displays":true}. An empty JSON object {} fetches all info. Results are cached for 2 seconds to prevent abuse.
include_proxy_domainsquerystringNoInclude proxy domains (aliases) for each container. When true, adds a proxy_domains array to each container object. Allowed: true, false
include_proxy_permissionsquerystringNoInclude the full proxy-permissions documents (container-level proxy_permissions and parent-project-level project_proxy_permissions) for each container. Returns proxy authentication group configuration including credentials — request only when explicitly needed. Auth tokens additionally require the resources.proxy_aliases permission. Allowed: true, false
include_prespawnquerystringNoInclude prespawn containers in the listing. By default, prespawn containers are excluded from results. Allowed: true, false
include_expiredquerystringNoInclude containers that have expired due to server termination. By default, expired containers are excluded from results. Allowed: true, false
include_deletingquerystringNoInclude containers currently being deleted. By default, deleting containers are excluded from results. Allowed: true, false
{
"statusCode": 200,
"message": "Containers retrieved successfully",
"data": {
"containers": [
{
"id": "507f1f77bcf86cd799439011",
"project_id": "507f1f77bcf86cd799439033",
"project_alias": "Production Environment",
"server_id": "507f1f77bcf86cd799439044",
"server_name": "node-sg-sin-1",
"subserver_name": "main",
"server": {
"name": "node-sg-sin-1",
"country": "SG",
"country_name": "Singapore",
"city": "Singapore",
"region": "Asia Pacific",
"datacenter": "SIN-DC1",
"is_free": true,
"specs": {
"cpu_cores": null,
"ram_gb": null,
"disk_gb": 20,
"shared_compute": true
}
},
"ssh_hostname": "507f1f77bcf86cd799439033-507f1f77bcf86cd799439011-ssh.node-sg-sin-1.containers.hoody.com",
"name": "web-app-1",
"color": "#3B82F6",
"container_image": "ubuntu/24.04",
"ai": true,
"hoody_kit": true,
"dev_kit": true,
"autostart": true,
"ramdisk": true,
"prespawn": false,
"is_default": false,
"status": "running",
"environment_vars": {
"NODE_ENV": "production"
},
"volumes": {},
"ssh_public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC...",
"comment": "Primary web application container",
"source_container_id": null,
"server_expired": false,
"server_expired_at": null,
"server_expired_reason": null,
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z",
"realm_ids": [],
"snapshot_count": 3,
"last_used_snapshot": "backup-2025-01-14",
"runtime_info": null,
"pool_id": null,
"has_proxy_permissions": true,
"proxy_permissions_scope": "container",
"has_proxy_domains": true,
"proxy_domains_count": 2
}
],
"pagination": {
"total": 5,
"page": 1,
"limit": 50,
"totalPages": 1
}
}
}
await client.api.containers.listIterator({
page: 1,
limit: 50,
sort_by: "created_at",
sort_order: "desc"
});

GET /api/v1/containers/{id}

Get a container by ID.

NameInTypeRequiredDescription
idpathstringYesUnique identifier of the container to retrieve
runtimequerystringNoInclude live runtime information. Accepts "true", "false", or a URL-encoded JSON string like {"displays":true}. An empty JSON object {} fetches all info. Results are cached for 2 seconds to prevent abuse.
include_proxy_domainsquerystringNoInclude proxy domains (aliases) for this container. When true, adds a proxy_domains array to the container object. Allowed: true, false
include_proxy_permissionsquerystringNoInclude the full proxy-permissions documents (container-level proxy_permissions and parent-project-level project_proxy_permissions) for each container. Returns proxy authentication group configuration including credentials — request only when explicitly needed. Auth tokens additionally require the resources.proxy_aliases permission. Allowed: true, false
{
"statusCode": 200,
"message": "Container retrieved successfully",
"data": {
"id": "507f1f77bcf86cd799439011",
"project_id": "507f1f77bcf86cd799439033",
"project_alias": "Production Environment",
"server_id": "507f1f77bcf86cd799439044",
"server_name": "node-sg-sin-1",
"subserver_name": "main",
"server": {
"name": "node-sg-sin-1",
"country": "SG",
"country_name": "Singapore",
"city": "Singapore",
"region": "Asia Pacific",
"datacenter": "SIN-DC1",
"is_free": true,
"specs": {
"cpu_cores": null,
"ram_gb": null,
"disk_gb": 20,
"shared_compute": true
}
},
"ssh_hostname": "507f1f77bcf86cd799439033-507f1f77bcf86cd799439011-ssh.node-sg-sin-1.containers.hoody.com",
"name": "web-app-1",
"color": "#3B82F6",
"container_image": "ubuntu/24.04",
"ai": true,
"hoody_kit": true,
"dev_kit": true,
"autostart": true,
"ramdisk": true,
"prespawn": false,
"is_default": false,
"status": "running",
"environment_vars": {
"NODE_ENV": "production"
},
"volumes": {},
"ssh_public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC...",
"comment": "Primary web application container",
"source_container_id": null,
"server_expired": false,
"server_expired_at": null,
"server_expired_reason": null,
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z",
"realm_ids": [],
"snapshot_count": 3,
"last_used_snapshot": "backup-2025-01-14",
"warnings": [],
"runtime_info": null,
"pool_id": null,
"has_proxy_permissions": true,
"proxy_permissions_scope": "container",
"has_proxy_domains": true,
"proxy_domains_count": 2
}
}
await client.api.containers.get({
id: "507f1f77bcf86cd799439011"
});

GET /api/v1/containers/{id}/stats

Get real-time resource usage statistics for a container including CPU, memory, disk, and network metrics. Useful for monitoring performance and troubleshooting resource issues.

NameInTypeRequiredDescription
idpathstringYesUnique identifier of the container
{
"statusCode": 200,
"message": "Container statistics retrieved successfully",
"data": {
"id": "507f1f77bcf86cd799439011",
"project_id": "507f1f77bcf86cd799439033",
"project_name": "Production Environment",
"server_name": "node-sg-sin-1",
"subserver_name": "main",
"status": "Running",
"status_code": 103,
"processes": 143,
"started_at": "2025-12-03T18:39:53.938688987Z",
"cpu": {
"usage": 17303605000
},
"memory": {
"usage": 1474666496,
"total": 131503332000
},
"disk": {
"root": {
"total": 0,
"usage": 11081670656
}
},
"network": [
{
"interface": "eth0",
"addresses": [
{
"address": "10.10.0.122",
"family": "inet",
"netmask": "30",
"scope": "global"
}
],
"counters": {
"bytes_received": 1098069936,
"bytes_sent": 16777319,
"packets_received": 346440,
"packets_sent": 242010,
"errors_received": 0,
"errors_sent": 0,
"packets_dropped_inbound": 0,
"packets_dropped_outbound": 0
},
"state": "up",
"type": "broadcast"
}
],
"processing_time": "3ms"
}
}
await client.api.containers.getStats({
id: "507f1f77bcf86cd799439011"
});

GET /api/v1/projects/{id}/containers

Get all containers for a project with pagination, filtering, and sorting.

NameInTypeRequiredDescription
idpathstringYesUnique identifier of the project
pagequerynumberNoPage number for pagination - starts from 1
limitquerynumberNoNumber of containers to return per page - maximum 100 items. Default: 50
sort_byquerystringNoField to sort containers by. Allowed: id, name, status, created_at, updated_at
sort_orderquerystringNoSort direction - ascending or descending. Allowed: asc, desc
runtimequerystringNoInclude live runtime information. Accepts "true", "false", or a URL-encoded JSON string like {"displays":true}. An empty JSON object {} fetches all info. Results are cached for 2 seconds to prevent abuse.
include_proxy_domainsquerystringNoInclude proxy domains (aliases) for each container. When true, adds a proxy_domains array to each container object. Allowed: true, false
include_proxy_permissionsquerystringNoInclude the full proxy-permissions documents (container-level proxy_permissions and parent-project-level project_proxy_permissions) for each container. Returns proxy authentication group configuration including credentials — request only when explicitly needed. Auth tokens additionally require the resources.proxy_aliases permission. Allowed: true, false
include_prespawnquerystringNoInclude prespawn containers in the listing. By default, prespawn containers are excluded. Allowed: true, false
include_deletingquerystringNoInclude containers currently being deleted. By default, deleting containers are excluded from results. Allowed: true, false
{
"statusCode": 200,
"message": "Containers retrieved successfully",
"data": {
"containers": [
{
"id": "507f1f77bcf86cd799439013",
"project_id": "507f1f77bcf86cd799439011",
"project_alias": "my-web-app",
"server_id": "507f1f77bcf86cd799439014",
"server_name": "node-us-nyc-1",
"subserver_name": "main",
"ssh_hostname": "507f1f77bcf86cd799439011-507f1f77bcf86cd799439013-ssh.node-us-nyc-1.containers.hoody.com",
"name": "frontend-prod",
"color": "#3B82F6",
"container_image": "ubuntu/22.04",
"ai": true,
"hoody_kit": true,
"dev_kit": true,
"autostart": true,
"prespawn": false,
"is_default": false,
"status": "running",
"environment_vars": {
"NODE_ENV": "production",
"PORT": "3000"
},
"volumes": {},
"ssh_public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl user@host",
"comment": "Production frontend server",
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T14:22:00.000Z",
"realm_ids": [],
"snapshot_count": 3,
"last_used_snapshot": "before-upgrade",
"runtime_info": null,
"pool_id": null,
"has_proxy_permissions": true,
"proxy_permissions_scope": "container",
"has_proxy_domains": true,
"proxy_domains_count": 2
}
],
"pagination": {
"total": 42,
"page": 1,
"limit": 20,
"totalPages": 3
}
}
}
await client.api.containers.listByProjectIterator({
id: "507f1f77bcf86cd799439011",
limit: 20
});

POST /api/v1/containers/{id}/authorize

Issues a signed, portable container authorization claim.

The returned container_claim is an ED25519-signed credential that proves:

  • Who the user is (sub, type)
  • Which container they are authorized for (containerId, projectId)
  • When Hoody issued the authorization (iat, exp)

Container programs can verify this claim offline using Hoody’s public key at GET /api/v1/meta/public-key — no API round-trip needed during verification.

Claims expire after HOODY_CONTAINER_CLAIM_EXPIRES_IN (default 6h). Clients should re-call this endpoint to refresh before expiry.

NameInTypeRequiredDescription
idpathstringYesContainer ID (24-char hex)
{
"statusCode": 200,
"message": "Container authorization claim issued",
"data": {
"container_claim": {
"kid": "v1",
"payload_b64": "eyJjbGFpbV90eXBlIjoiY29udGFpbmVyIiwi...",
"signature_hex": "a1b2c3d4e5f6..."
},
"expires_in": 21600,
"container_id": "abc123def456abc123def456",
"project_id": "def456abc123def456abc123"
}
}

The successful response also includes an X-Hoody-Signature header containing an ED25519 signature of the response body. Format: t=<unix_ts>,kid=<keyId>,path=<urlPath>,sig=<128-hex>.

await client.api.containers.authorize({
id: "507f1f77bcf86cd799439011"
});

POST /api/v1/projects/{id}/containers

Create a new container for a project.

NameInTypeRequiredDescription
idpathstringYesUnique identifier of the project
NameTypeRequiredDescription
server_idstringYesIdentifier of the server that will host the container.
namestringNoName for the container. Must be 3-100 characters, alphanumeric with hyphens and underscores. Omit or use "rand" to generate a random name.
colorstringNoHEX color for the container (e.g., #FF0000 or FF0000). The # prefix is added automatically if missing, and the color is converted to uppercase.
container_imagestringNoContainer image to use. If null or not provided, the default configured image is used.
aibooleanNoWhether AI features are enabled. Default: true
environment_varsobjectNoEnvironment variables to set in the container as key-value string pairs. Up to 200 properties, each value up to 65536 characters. Property names must match ^[a-zA-Z_][a-zA-Z0-9_]*$.
ssh_public_keystringNoSSH public key for container access. SSH public keys must be unique per container (one container per key). If not provided, the key is inherited from project defaults.
commentstringNoOptional comment for the container (max 16000 characters).
hoody_kitbooleanNoEnable all Hoody Kit features. Default: true
dev_kitbooleanNoEnable dev_kit development tools in the container. Defaults to true when hoody_kit is true, false otherwise (unless explicitly set). Cannot be updated after creation.
autostartbooleanNoWhether the container should start automatically on host boot. Default: true
ramdiskbooleanNoWhether to mount a ramdisk at /ramdisk in the container. Default: true
cachebooleanNoEnable use of cached images during container creation. Default: true
cache_imagebooleanNoForce creation of a new cached image from the container image. Only available to admins or the owner of the image. Default: false
prespawnbooleanNoCreate container as prespawn cache. Prespawn containers are excluded from default listings and quota counts. Default: false
bypass_prespawnbooleanNoBypass prespawn container claiming and create a fresh container directly. Default: false
realm_idsarrayNoRealm IDs to assign this container to. If creating from a realm subdomain, the subdomain realm is automatically included and merged with any explicitly provided realm_ids.
{
"server_id": "507f1f77bcf86cd799439014",
"name": "backend-api",
"color": "#10B981",
"container_image": "ubuntu/22.04",
"ai": true,
"hoody_kit": true,
"dev_kit": true,
"autostart": true,
"ramdisk": true,
"environment_vars": {
"DATABASE_URL": "postgresql://user:pass@db:5432/app",
"REDIS_URL": "redis://cache:6379"
},
"ssh_public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl user@host",
"comment": "Backend API server with PostgreSQL connection",
"realm_ids": []
}
{
"statusCode": 201,
"message": "Container created successfully",
"data": {
"id": "507f1f77bcf86cd799439015",
"project_id": "507f1f77bcf86cd799439011",
"project_alias": "my-web-app",
"server_id": "507f1f77bcf86cd799439014",
"server_name": "node-us-nyc-1",
"subserver_name": "main",
"ssh_hostname": "507f1f77bcf86cd799439011-507f1f77bcf86cd799439015-ssh.node-us-nyc-1.containers.hoody.com",
"name": "backend-api",
"color": "#10B981",
"container_image": "ubuntu/22.04",
"ai": true,
"hoody_kit": true,
"dev_kit": true,
"autostart": true,
"prespawn": false,
"status": "provisioning",
"environment_vars": {
"DATABASE_URL": "postgresql://user:pass@db:5432/app",
"REDIS_URL": "redis://cache:6379"
},
"volumes": {},
"ssh_public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl user@host",
"comment": "Backend API server with PostgreSQL connection",
"created_at": "2025-01-15T15:45:00.000Z",
"updated_at": "2025-01-15T15:45:00.000Z",
"realm_ids": []
}
}
await client.api.containers.create({
id: "507f1f77bcf86cd799439011",
data: {
server_id: "507f1f77bcf86cd799439014",
name: "backend-api",
color: "#10B981",
container_image: "ubuntu/22.04",
environment_vars: {
DATABASE_URL: "postgresql://user:pass@db:5432/app"
}
}
});

PATCH /api/v1/containers/{id}

Update a container. Only the fields included in the request body are modified; omitted fields keep their current value.

NameInTypeRequiredDescription
idpathstringYesUnique identifier of the container to update
NameTypeRequiredDescription
namestringNoHuman-readable name for the container. Must be unique within the project, 1-100 characters.
colorstringNoHEX color for the container (e.g., #FF0000 or FF0000). The # prefix is added automatically if missing, and the color is converted to uppercase.
aibooleanNoWhether AI features are enabled. If omitted, the current value is preserved.
autostartbooleanNoWhether the container starts automatically on host boot. If omitted, the current value is preserved.
ramdiskbooleanNoWhether to mount a ramdisk at /ramdisk in the container. If omitted, the current value is preserved.
environment_varsobjectNoEnvironment variables to set in the container as key-value string pairs. Up to 200 properties, each value up to 65536 characters. Property names must match ^[a-zA-Z_][a-zA-Z0-9_]*$.
ssh_public_keystringNoSSH public key for container access. SSH public keys must be unique per container (one container per key). Re-sending the same key for the same container is treated as a no-op. Set to null to clear or inherit from project defaults.
commentstringNoOptional comment for the container (max 16000 characters). Set to null to clear existing comment.
realm_idsarrayNoUpdate realm membership for this container. Only unrestricted tokens and admin users can modify realm_ids; realm-restricted tokens cannot change realm membership for security.
{
"name": "backend-api-v2",
"color": "#10B981",
"ai": true,
"autostart": true,
"ramdisk": true,
"environment_vars": {
"LOG_LEVEL": "info"
},
"comment": "Updated backend API server"
}
{
"statusCode": 200,
"message": "Container updated successfully",
"data": {
"id": "507f1f77bcf86cd799439011",
"project_id": "507f1f77bcf86cd799439033",
"project_alias": "Production Environment",
"server_id": "507f1f77bcf86cd799439044",
"server_name": "node-sg-sin-1",
"subserver_name": "main",
"server": {
"name": "node-sg-sin-1",
"country": "SG",
"country_name": "Singapore",
"city": "Singapore",
"region": "Asia Pacific",
"datacenter": "SIN-DC1",
"is_free": true,
"specs": {
"cpu_cores": null,
"ram_gb": null,
"disk_gb": 20,
"shared_compute": true
}
},
"ssh_hostname": "507f1f77bcf86cd799439033-507f1f77bcf86cd799439011-ssh.node-sg-sin-1.containers.hoody.com",
"name": "backend-api-v2",
"color": "#10B981",
"container_image": "ubuntu/24.04",
"ai": true,
"hoody_kit": true,
"dev_kit": true,
"autostart": true,
"ramdisk": true,
"prespawn": false,
"is_default": false,
"status": "running",
"environment_vars": {
"LOG_LEVEL": "info"
},
"volumes": {},
"ssh_public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC...",
"comment": "Updated backend API server",
"source_container_id": null,
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-20T09:15:00.000Z",
"realm_ids": [],
"pool_id": null
}
}
await client.api.containers.update({
id: "507f1f77bcf86cd799439011",
data: {
name: "backend-api-v2",
environment_vars: {
LOG_LEVEL: "info"
}
}
});

DELETE /api/v1/containers/{id}

Delete a container.

NameInTypeRequiredDescription
idpathstringYesUnique identifier of the container to delete
{
"statusCode": 200,
"message": "Container deleted successfully"
}
await client.api.containers.delete({
id: "507f1f77bcf86cd799439011"
});