Create SQL workbook

Create a workbook that holds the SQL content and its version. On success, the response returns the workbook ID, which is used to create and manage versions.

HTTP
POST $CLOUDSIGMA_API_BASE/workbook/create

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. Prepare personal access token and target workspace ID with access rights to the target workspace and permission to create workbooks.

Request body

Replace $CLOUDSIGMA_API_KEY, $WORKSPACE_ID and $WORKBOOK_NAME with actual values.

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/workbook/create" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d "{
    \"name\": \"$WORKBOOK_NAME\"
  }"

Parameter

Type

Required

Description

name

string

Yes

SQL workbook name.

Successful response

JSON
{
  "code": 200,
  "data": {
    "workbook_id": "wb_019a15d7-4c00-7000-8000-000000000001",
    "name": "销售分析"
  }
}

Field

Type

Description

code

integer

200 on success.

data

object

Information about creating a new workbook.

data.workbook_id

string

ID of the new SQL workbook.

data.name

string

SQL workbook name.

Error response

JSON
{
  "code": 400,
  "message": "请求参数无效"
}

Field

Type

Description

code

integer

Error status code.

message

string

error message.

Common HTTP errors

HTTP status

Error code

Common cause

Recommended action

400

400

Invalid request field, workspace, or operation precondition.

Fix the request parameters and submit again.

401

Unauthorized, ErrServiceUnavailable, ErrIAMExplicitRoleInvalid

Missing or invalid authentication credentials.

Check the credential type, expiration, and authentication header.

403

403

The current identity or active role does not have permission for this operation.

Use an authorized identity or contact an administrator to grant access.

404

404

The target object or required reference was not found.

Verify the object identifier, workspace, and current status.

409

409

Conflict in resource state, request payload, or concurrent modification.

Re-read the current state and version, then handle according to the latest result.

500

500

Internal processing failed; write operations may have been partially applied.

Retain request and trace details, and verify the current state before retrying.

503

503

A business, runtime, or authorization dependency is temporarily unavailable.

After the dependency recovers, check existing results first instead of blindly repeating writes.

Last updated on