Upload files

Upload a file that is not associated with a volume. After uploading, you can associate it to the volume through Associate file to volume.

HTTP
POST $CLOUDSIGMA_API_BASE/catalog/file/upload

Before you call

Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Use multipart/form-data request. Prepare a personal access token and target workspace ID that can access the target workspace.

Request parameters

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/catalog/file/upload" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -F "file=@./orders.csv"

form fields

Field

Type

Required

Description

file

file

Yes

The local file to upload.

32 MiB is the memory threshold for upload parsing, not the file size limit. The service first creates the file record and then writes the file content. When writing fails, file records may remain.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "file_id": "file-123"
  }
}

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data.file_id

string

The file ID generated after uploading. Can be used to create file requests.

Error response

JSON
{
  "code": "ErrParamInvalid",
  "msg": "缺少 file 字段"
}

Field

Type

Description

code

string

error code.

msg

string

error message.

Last updated on