# Query skill version

Lists the skill's version snapshot. This interface can explicitly read the skill version in the current workspace or system workspace.

```text
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/skills/{skill_id}/versions
```

## Before you call

First [query the skill list](list-skills.md) to obtain the skill ID. Prepare the personal access token, target workspace ID, and skill ID that have access to the target workspace.

The example below uses:

- `$AI_STUDIO_API_KEY`: The actual personal access token, passed through the `X-API-Key` Header.
- `$WORKSPACE_ID`: Target workspace ID, passed through `X-Workspace-ID` Header.
- `$SKILL_ID`: Skill ID.

## Request example

```bash
curl "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/skills/$SKILL_ID/versions?limit=20&offset=0" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"
```

## Path parameters

| Parameters | Type | Is it required | Description |
| --- | --- | --- | --- |
| `workspace_id` | string | Yes | The current workspace ID. |
| `skill_id` | string | Yes | Skill ID. |

## Query parameters

| Parameters | Type | Is it required | Description |
| --- | --- | --- | --- |
| `skill_workspace_id` | string | No | The workspace to which the skill belongs; can only be the current workspace or `system`. |
| `limit` | integer | No | Quantity per page. Default `50`, maximum `200`. |
| `offset` | integer | No | Starting offset; negative numbers are treated as `0`. |

## Successful response

Returns `200` on success.

```json
{
  "code": 0,
  "data": {
    "items": [
      {
        "id": "skill_ver_02",
        "workspace_id": "ws_01",
        "skill_id": "skill_01",
        "version": 2,
        "spec_snapshot": {
          "name": "摘要技能",
          "status": "active"
        },
        "change_summary": "补充输出约定",
        "created_at": "2026-01-03T10:00:00Z"
      }
    ],
    "total": 2,
    "limit": 20,
    "offset": 0
  }
}
```

The response fields are as follows.

| Field | Type | Description |
| --- | --- | --- |
| `code` | integer | `0` on success. |
| `data.items` | array | The skill version of the current page. |
| `data.items[].id` | string | Version record ID and skill ID. |
| `data.items[].skill_id` | string | Version record ID and skill ID. |
| `data.items[].workspace_id` | string | The workspace and version number it belongs to. |
| `data.items[].version` | integer | The workspace and version number. |
| `data.items[].spec_snapshot` | object | A snapshot of the complete skill definition when this version was saved. |
| `data.items[].change_summary` | string | Change description and creation time. |
| `data.items[].created_at` | string | Change description and creation time. |
| `data.total` | integer | The total number of matches, the size of this page and the starting offset. |
| `data.limit` | integer | The total number of matches, the size of this page and the starting offset. |
| `data.offset` | integer | The total number of matches, the size of this page and the starting offset. |

`[]` after a type denotes an array. `[]` in a field path denotes each item in an array.


## Error response

```json
{
  "code": 2,
  "message": "<错误信息>"
}
```

### Common HTTP errors

```{list-table}
:header-rows: 1
:widths: 12 22 32 34

* - HTTP status code
  - error code
  - Common causes
  - Recommended actions
* - `400`
  - `2`（`INVALID_ARGUMENT`）
  - Invalid skill ID, workspace range, or paging parameters.
  - Check path and query parameters.
* - `401`
  - `6`（`UNAUTHENTICATED`）
  - Lack of valid identity credentials.
  - Check API Key.
* - `403`
  - `5`（`PERMISSION_DENIED`）
  - The current identity does not have permission to read the skill version.
  - Check workspace authorization.
* - `404`
  - `3`（`NOT_FOUND`）
  - The skill or version record does not exist in the specified workspace.
  - Check skill ID and `skill_workspace_id`.
* - `503`
  - `15`（`UNAVAILABLE`）
  - Skill services or authorized dependencies are temporarily unavailable.
  - Try again later.
```

## Follow-up operations

After selecting the version, you can [Set the current skill version](set-current-skill-version.md); when you need skill subject information, [Query skill details](get-skill.md).
