Skip to content
Hoody.com

Container snapshots capture the full filesystem state of a container at a point in time. They let you back up a container before a risky change, restore a container to a known good state, or label recurring checkpoints with a friendly alias. The endpoints on this page cover listing, creating, restoring, aliasing, and deleting snapshots on a single container.

Return every snapshot that currently exists on a container, along with the container’s snapshot cap and the current count.

NameInTypeRequiredDescription
idpathstringYesUnique identifier of the container to retrieve snapshots for
Terminal window
curl -X GET "https://api.hoody.com/api/v1/containers/{id}/snapshots" \
-H "Authorization: Bearer <token>"
{
"statusCode": 200,
"message": "Snapshots retrieved successfully",
"data": {
"container_id": "507f1f77bcf86cd799439011",
"project_id": "507f1f77bcf86cd799439033",
"snapshot_count": 2,
"max_snapshots": 10,
"snapshots": [
{
"name": "snap-20250115-103000",
"alias": "backup-2025-01-15",
"created_at": "2025-01-15T10:30:00.000Z",
"last_used_at": "2025-01-15T14:00:00.000Z",
"expires_at": "2025-02-15T10:30:00.000Z",
"stateful": false,
"size": 2147483648
},
{
"name": "snap-20250110-080000",
"alias": "weekly-backup",
"created_at": "2025-01-10T08:00:00.000Z",
"last_used_at": null,
"expires_at": null,
"stateful": false,
"size": 1073741824
}
]
}
}

Capture a new snapshot of a container. Optional fields let you attach a human-friendly alias and an expiry window in days.

NameInTypeRequiredDescription
idpathstringYesUnique identifier of the container to create snapshot for
NameTypeRequiredDescription
aliasstringNoOptional user-friendly alias for the snapshot. Maximum 100 characters.
expiryintegerNoExpiry in days, between 1 and 3650. Values outside this range are rejected before the snapshot is created.
Terminal window
curl -X POST "https://api.hoody.com/api/v1/containers/{id}/snapshots" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"alias": "pre-deployment-backup",
"expiry": 30
}'
{
"statusCode": 201,
"message": "Snapshot created successfully",
"data": {
"container_id": "507f1f77bcf86cd799439011",
"project_id": "507f1f77bcf86cd799439033",
"snapshot": {
"name": "snap-20250115-145500",
"alias": "pre-deployment-backup",
"created_at": "2025-01-15T14:55:00.000Z",
"last_used_at": null,
"expires_at": "2025-02-14T14:55:00.000Z",
"stateful": false,
"size": 2147483648
}
}
}

PUT /api/v1/containers/{id}/snapshots/{name}

Section titled “PUT /api/v1/containers/{id}/snapshots/{name}”

Replace the container’s current filesystem with the contents of a named snapshot. The server also accepts PATCH for this endpoint with identical behaviour; the canonical verb is PUT to match the SDK.

NameInTypeRequiredDescription
idpathstringYesUnique identifier of the container to restore
namepathstringYesThe snapshot’s canonical name as returned by the list endpoint. For a snapshot created with an alias this is the sanitized alias (letters, digits, underscore, hyphen; leading hyphens stripped); without an alias, or when sanitization leaves nothing, a timestamped snap-YYYYMMDD-HHMMSS.
Terminal window
curl -X PUT "https://api.hoody.com/api/v1/containers/{id}/snapshots/{name}" \
-H "Authorization: Bearer <token>"
{
"statusCode": 200,
"message": "Container restored from snapshot successfully",
"data": {
"success": true,
"message": "Container restored from snapshot successfully",
"snapshot": {
"name": "snap-20250115-103000",
"alias": "backup-2025-01-15",
"created_at": "2025-01-15T10:30:00.000Z",
"last_used_at": "2025-01-15T15:00:00.000Z",
"expires_at": "2025-02-15T10:30:00.000Z",
"stateful": false,
"size": 2147483648
}
}
}

PUT /api/v1/containers/{id}/snapshots/{name}/alias

Section titled “PUT /api/v1/containers/{id}/snapshots/{name}/alias”

Set a new alias on an existing snapshot, or clear the alias by passing null. The server also accepts PATCH for this endpoint with identical behaviour; the canonical verb is PUT to match the SDK.

NameInTypeRequiredDescription
idpathstringYesUnique identifier of the container
namepathstringYesThe snapshot’s canonical name as returned by the list endpoint. For a snapshot created with an alias this is the sanitized alias (letters, digits, underscore, hyphen; leading hyphens stripped); without an alias, or when sanitization leaves nothing, a timestamped snap-YYYYMMDD-HHMMSS.
NameTypeRequiredDescription
aliasstringYesNew alias for the snapshot. Maximum 100 characters. Pass null to remove the existing alias.
Terminal window
curl -X PUT "https://api.hoody.com/api/v1/containers/{id}/snapshots/{name}/alias" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"alias": "production-baseline"
}'
{
"statusCode": 200,
"message": "Snapshot alias updated successfully",
"data": {
"container_id": "507f1f77bcf86cd799439011",
"project_id": "507f1f77bcf86cd799439033",
"snapshot": {
"name": "snap-20250115-103000",
"alias": "production-baseline",
"created_at": "2025-01-15T10:30:00.000Z",
"last_used_at": "2025-01-15T14:00:00.000Z",
"expires_at": "2025-02-15T10:30:00.000Z",
"stateful": false,
"size": 2147483648
}
}
}

DELETE /api/v1/containers/{id}/snapshots/{name}

Section titled “DELETE /api/v1/containers/{id}/snapshots/{name}”

Permanently remove a snapshot from a container. The container itself is untouched.

NameInTypeRequiredDescription
idpathstringYesUnique identifier of the container
namepathstringYesThe snapshot’s canonical name as returned by the list endpoint. For a snapshot created with an alias this is the sanitized alias (letters, digits, underscore, hyphen; leading hyphens stripped); without an alias, or when sanitization leaves nothing, a timestamped snap-YYYYMMDD-HHMMSS.
Terminal window
curl -X DELETE "https://api.hoody.com/api/v1/containers/{id}/snapshots/{name}" \
-H "Authorization: Bearer <token>"
{
"statusCode": 200,
"message": "Snapshot deleted successfully",
"data": {
"container_id": "507f1f77bcf86cd799439011",
"project_id": "507f1f77bcf86cd799439033",
"snapshot_name": "snap-20250110-080000"
}
}