Query skill files

Lists static file metadata imported with skill packs. This interface only queries the skills in the current workspace and will not fall back to system skills.

HTTP
GET $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/skills/{skill_id}/files

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. First query the skill list or import the skill package to obtain the skill ID. Prepare the personal access token, target workspace ID, and skill ID that can access the target workspace.

Request parameters

Shell
curl "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/skills/$SKILL_ID/files" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Path parameters

Parameter

Type

Required

Description

workspace_id

string

Yes

Current workspace ID.

skill_id

string

Yes

Skill ID.

Successful response

JSON
{
  "code": 0,
  "data": {
    "items": [
      {
        "file_path": "references/guide.md",
        "file_kind": "reference",
        "media_type": "text/markdown",
        "sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "size_bytes": 1024
      }
    ],
    "total": 1
  }
}

Field

Type

Description

code

integer

0 on success.

data

object

The result of this request.

data.items

array

Result list.

data.items[].file_path

string

Relative file path within the skill package. Can be omitted if empty or not set.

data.items[].file_kind

string

File category. Preferable manifest, reference, asset, script, other. Can be omitted if empty or not set.

data.items[].media_type

string

File media type. Can be omitted if empty or not set.

data.items[].sha256

string

SHA-256 digest of the file contents. Can be omitted if empty or not set.

data.items[].size_bytes

integer

File size in bytes. Can be omitted if empty or not set.

data.total

integer

The total number of matching records.

Error response

JSON
{
  "code": 3,
  "message": "<错误信息>"
}

Common HTTP errors

HTTP status code

error code

Description

400

2(INVALID_ARGUMENT)

Common reasons: The path parameter is invalid. Recommended Action: Check the workspace and skill IDs.

401

6(UNAUTHENTICATED)

Common Cause: Valid identity credentials are missing. Recommended Action: Check the API Key.

403

5(PERMISSION_DENIED)

Common reasons: The current identity does not have permission to read the skill file. Recommended Action: Check the workspace authorization.

404

3(NOT_FOUND)

Common reasons: The skill does not exist. Recommended Action: Check the skill ID. Confirm that the skill is imported by the skill package and contains static files.

503

15(UNAVAILABLE)

Common reasons: Skill pack storage is not available. Recommended Action: Try again later.

Last updated on