# Query calculation specification management permissions

Query whether the current identity can create, update, or enable or disable the computing specifications of the current workspace.

```text
GET https://moi.matrixorigin.cn/newmoi/compute-resource-specs/management-permission
```

## Preparation before calling

Prepare a personal access token and target workspace ID that has 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`: The workspace ID to be queried is passed through the `X-Workspace-ID` Header.

Returning `false` means that the current identity does not have specification management rights; do not call create, update, enable, or deactivate interfaces at this time.

## Request example

```bash
curl "https://moi.matrixorigin.cn/newmoi/compute-resource-specs/management-permission" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"
```

## Successful response

Returns `200` on success. `data.can_manage_specs` indicates whether the current identity has specification management permissions.

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "can_manage_specs": false
  }
}
```

The response fields are as follows.

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | `OK` on success. |
| `msg` | string | `OK` on success. |
| `data` | object | Permission query results. |
| `data.can_manage_specs` | boolean | `true` means that the computing specifications can be managed; `false` means that it does not have this permission. |

## Error response

```json
{
  "code": "ErrApiKeyInvalid",
  "msg": "API key is invalid or expired",
  "data": null
}
```

### Common HTTP errors

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

* - HTTP status code
  - error code
  - Common causes
  - Recommended actions
* - `401`
  - —
  - Missing or invalid access credentials.
  - Check API Key and Workspace Header.
* - `500`
  - `GET_SPEC_MANAGEMENT_PERMISSION_FAILED`
  - The server cannot read the permission result.
  - Try again later; if it continues to fail, contact support.
```

## Follow-up operations

When `data.can_manage_specs` is `true`, you can [Create calculation specification](create-compute-resource-spec.md); when it is `false`, contact the workspace administrator to apply for permission.
