Hubfly spaceDocs
Console

Box API · Dashboard

Data volumes

Create, attach, detach, resize and delete persistent Box data volumes.

Base URL: https://api.hubfly.space. Use a Dashboard bearer token authorized for the project. Replace :projectId in each path with the Dashboard project ID. JSON routes use Content-Type: application/json.

How to use these endpoints

  1. Create a project volume with a name and size in GiB.
  2. Attach it to a Box, then partition, format and mount it in the guest.
  3. Resize a volume upward when needed; grow its guest filesystem or LVM separately.
  4. Detach before deleting if your application still uses the disk.

Create a data volume

curl
curl -X POST "https://api.hubfly.space/api/v1/projects/$PROJECT_ID/box-volumes/create" \
  -H "Authorization: Bearer $HUBFLY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"app-data","sizeGib":50}'

The response uses the standard Dashboard envelope: ok, data, and meta on success. On failure, use the returned error code and message to decide whether to correct the request or retry. The exact schema and response codes for each operation are below.

Endpoint reference

Dashboard endpoints (3)

These JSON routes are served by the Hubfly space Dashboard API and use Dashboard project authorization.

Open interactive API explorer
POSTCreate a data volumeDetails +/api/v1/projects/:projectId/box-volumes/create

Create a project data volume of the requested GiB capacity. Attach it separately before using it in a guest.

Request parameters
NameLocationRequiredTypeDescription
projectIdpathYesstring—

JSON request body

FieldType / allowed valuesRequired
namestringYes
sizeGibnumberYes
Complete request schema
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "sizeGib": {
      "type": "number"
    }
  },
  "required": [
    "name",
    "sizeGib"
  ],
  "additionalProperties": false
}
Responses
  • 200 — Successful response
    Response schema
    {
      "type": "object",
      "properties": {
        "ok": {
          "const": true,
          "type": "boolean"
        },
        "data": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "operationId": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "operationId"
          ],
          "additionalProperties": false
        },
        "meta": {
          "type": "object",
          "properties": {
            "requestId": {
              "type": "string"
            },
            "timestamp": {
              "type": "string"
            }
          },
          "required": [
            "requestId",
            "timestamp"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "ok",
        "data",
        "meta"
      ],
      "additionalProperties": false
    }
    Example response
    {
      "ok": true,
      "data": {
        "id": "string",
        "operationId": "string"
      },
      "meta": {
        "requestId": "string",
        "timestamp": "string"
      }
    }
GETList data volumesDetails +/api/v1/projects/:projectId/box-volumes

Read project data volumes, sizes, attachment targets and provisioning states.

Request parameters
NameLocationRequiredTypeDescription
projectIdpathYesstring—
Responses
  • 200 — Successful response
    Response schema
    {
      "type": "object",
      "properties": {
        "ok": {
          "const": true,
          "type": "boolean"
        },
        "data": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "createdAt": {
                "type": "string",
                "description": "Date string"
              },
              "updatedAt": {
                "type": "string",
                "description": "Date string"
              },
              "id": {
                "type": "string"
              },
              "projectId": {
                "type": "string"
              },
              "runtimeId": {
                "type": "string",
                "nullable": true
              },
              "name": {
                "type": "string"
              },
              "sizeGib": {
                "type": "number"
              },
              "format": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "attachedBoxId": {
                "type": "string",
                "nullable": true
              },
              "target": {
                "type": "string",
                "nullable": true
              },
              "deletedAt": {
                "type": "string",
                "description": "Date string",
                "nullable": true
              }
            },
            "required": [
              "createdAt",
              "updatedAt",
              "id",
              "projectId",
              "runtimeId",
              "name",
              "sizeGib",
              "format",
              "status",
              "attachedBoxId",
              "target",
              "deletedAt"
            ],
            "additionalProperties": false
          }
        },
        "meta": {
          "type": "object",
          "properties": {
            "requestId": {
              "type": "string"
            },
            "timestamp": {
              "type": "string"
            }
          },
          "required": [
            "requestId",
            "timestamp"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "ok",
        "data",
        "meta"
      ],
      "additionalProperties": false
    }
    Example response
    {
      "ok": true,
      "data": [
        {
          "createdAt": "string",
          "updatedAt": "string",
          "id": "string",
          "projectId": "string",
          "runtimeId": "string",
          "name": "string",
          "sizeGib": 0,
          "format": "string",
          "status": "string",
          "attachedBoxId": "string",
          "target": "string",
          "deletedAt": "string"
        }
      ],
      "meta": {
        "requestId": "string",
        "timestamp": "string"
      }
    }
POSTChange a data volumeDetails +/api/v1/projects/:projectId/box-volumes/:volumeId/mutate

Request attach, detach, grow, or delete. Size is used for growth; boxId and target select attachment. Follow the operation.

Request parameters
NameLocationRequiredTypeDescription
projectIdpathYesstring—
volumeIdpathYesstring—

JSON request body

FieldType / allowed valuesRequired
actiondelete | resize | attach | detachYes
sizeGibnumberNo
boxIdstringNo
targetstringNo
Complete request schema
{
  "type": "object",
  "properties": {
    "action": {
      "type": "string",
      "enum": [
        "delete",
        "resize",
        "attach",
        "detach"
      ]
    },
    "sizeGib": {
      "type": "number"
    },
    "boxId": {
      "type": "string"
    },
    "target": {
      "type": "string"
    }
  },
  "required": [
    "action"
  ],
  "additionalProperties": false
}
Responses
  • 200 — Successful response
    Response schema
    {
      "type": "object",
      "properties": {
        "ok": {
          "const": true,
          "type": "boolean"
        },
        "data": {
          "type": "object",
          "properties": {
            "operationId": {
              "type": "string"
            }
          },
          "required": [
            "operationId"
          ],
          "additionalProperties": false
        },
        "meta": {
          "type": "object",
          "properties": {
            "requestId": {
              "type": "string"
            },
            "timestamp": {
              "type": "string"
            }
          },
          "required": [
            "requestId",
            "timestamp"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "ok",
        "data",
        "meta"
      ],
      "additionalProperties": false
    }
    Example response
    {
      "ok": true,
      "data": {
        "operationId": "string"
      },
      "meta": {
        "requestId": "string",
        "timestamp": "string"
      }
    }

Related guides

Something unclear or out of date? Emailsupport@hubfly.spaceBack to top