# View operator API service configuration

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

Check whether the specified operator version has been released, as well as the name, status, and input definitions required to call the service.

```text
GET https://moi.matrixorigin.cn/newmoi/workflow/v2/workitems/catalog/$NODE_ID/api-service?version=$VERSION
```

## Preparation before calling

First [View operator list](../operator-catalog/list-operators.md) to confirm the operator you want to view and its version. Prepare the personal access token, target workspace ID, operator ID, and version that has access to the target workspace.


## Request parameters

::::{div} mo-api-split
:::{div} mo-api-split-main

```{raw} html
<dl class="mo-api-fields">
  <div class="mo-api-field"><dt><code>node_id</code><span class="mo-api-field__type">string</span><span class="mo-api-field__required">Required</span></dt><dd>Operator ID. It can be obtained from the [View operator list](../operator-catalog/list-operators.md) response.</dd></div>
  <div class="mo-api-field"><dt><code>version</code><span class="mo-api-field__type">string</span><span class="mo-api-field__required">Required</span></dt><dd>Operator version.</dd></div>
</dl>
```

:::
:::{div} mo-api-split-aside

```{raw} html
<p class="mo-api-example-label">Request example</p>
```

```bash
curl "https://moi.matrixorigin.cn/newmoi/workflow/v2/workitems/catalog/$NODE_ID/api-service?version=$VERSION" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"
```

:::
::::

## Successful response

The response returns the service configuration. Only after confirming that the service is enabled can you [call service](invoke-operator-api-service.md); when calling, the returned service name, version and input definition will be used as is for the request.


The response fields are as follows.

::::{div} mo-api-split
:::{div} mo-api-split-main

```{raw} html
<dl class="mo-api-fields">
  <div class="mo-api-field"><dt><code>code</code><span class="mo-api-field__type">string</span></dt><dd>OK on success.</dd></div>
  <div class="mo-api-field"><dt><code>msg</code><span class="mo-api-field__type">string</span></dt><dd>OK on success.</dd></div>
  <div class="mo-api-field"><dt><code>data.service.api_service_id</code><span class="mo-api-field__type">string</span></dt><dd>Service ID.</dd></div>
  <div class="mo-api-field"><dt><code>data.service.operator_id</code><span class="mo-api-field__type">integer</span></dt><dd>Published custom operator ID.</dd></div>
  <div class="mo-api-field"><dt><code>data.service.node_id</code><span class="mo-api-field__type">string</span></dt><dd>Published operator ID.</dd></div>
  <div class="mo-api-field"><dt><code>data.service.version</code><span class="mo-api-field__type">string</span></dt><dd>Published operator version.</dd></div>
  <div class="mo-api-field"><dt><code>data.service.service_name</code><span class="mo-api-field__type">string</span></dt><dd>The service name that must be passed in when calling the service.</dd></div>
  <div class="mo-api-field"><dt><code>data.service.status</code><span class="mo-api-field__type">string</span></dt><dd>unpublished means it has not been released yet, ready means it can be called, and disabled means it has been deactivated.</dd></div>
  <div class="mo-api-field"><dt><code>data.service.result_mode</code><span class="mo-api-field__type">string</span></dt><dd>The service result return mode.</dd></div>
  <div class="mo-api-field"><dt><code>data.service.auth_mode</code><span class="mo-api-field__type">string</span></dt><dd>The authentication mode of the service.</dd></div>
  <div class="mo-api-field"><dt><code>data.service.method</code><span class="mo-api-field__type">string</span></dt><dd>The HTTP method used to call the service.</dd></div>
  <div class="mo-api-field"><dt><code>data.service.path</code><span class="mo-api-field__type">string</span></dt><dd>Relative path to the calling service.</dd></div>
  <div class="mo-api-field"><dt><code>data.service.workflow_id</code><span class="mo-api-field__type">string</span></dt><dd>The workflow ID associated with the service; returned if there is a value.</dd></div>
  <div class="mo-api-field"><dt><code>data.service.workflow_def_id</code><span class="mo-api-field__type">string</span></dt><dd>The workflow definition ID associated with the service; returned if there is a value.</dd></div>
  <div class="mo-api-field"><dt><code>data.service.workflow_version_id</code><span class="mo-api-field__type">string</span></dt><dd>The workflow version ID associated with the service; returned if there is a value.</dd></div>
  <div class="mo-api-field"><dt><code>data.service.input_schema</code><span class="mo-api-field__type">string</span></dt><dd>Input data definition. Fill in the payload of the calling request according to its fields and types.</dd></div>
  <div class="mo-api-field"><dt><code>data.service.output_schema</code><span class="mo-api-field__type">string</span></dt><dd>Output data definition; returned if there is a value.</dd></div>
  <div class="mo-api-field"><dt><code>data.service.compute_resource_id</code><span class="mo-api-field__type">string</span></dt><dd>The computing resource ID used by the service; returned if there is a value.</dd></div>
  <div class="mo-api-field"><dt><code>data.service.timeout_seconds</code><span class="mo-api-field__type">integer</span></dt><dd>Timeout for a single call, in seconds; returned if there is a value.</dd></div>
  <div class="mo-api-field"><dt><code>data.service.max_concurrency</code><span class="mo-api-field__type">integer</span></dt><dd>The maximum number of concurrent calls; returned when there is a value.</dd></div>
  <div class="mo-api-field"><dt><code>data.service.rate_limit_per_min</code><span class="mo-api-field__type">integer</span></dt><dd>Maximum number of calls per minute; returned if there is a value.</dd></div>
  <div class="mo-api-field"><dt><code>data.service.invoke</code><span class="mo-api-field__type">object</span></dt><dd>Information required to call the service; returned if there is a value.</dd></div>
  <div class="mo-api-field"><dt><code>data.service.deployment</code><span class="mo-api-field__type">object</span></dt><dd>Service deployment information; returned if there is a value.</dd></div>
</dl>
```

:::
:::{div} mo-api-split-aside

```{raw} html
<p class="mo-api-example-label">Successful response example</p>
```

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "service": {
      "api_service_id": "api_2e859efcedc1e0efea48b465b2197784",
      "node_id": "moi:data.sql.process",
      "version": "v1",
      "service_name": "operator-api-37f61ebdaa18aa51",
      "status": "ready",
      "method": "POST",
      "path": "/newmoi/workflow/v2/workitems/catalog/moi:data.sql.process/api-service/invoke",
      "input_schema": "{\"type\":\"object\",\"properties\":{\"sql\":{\"type\":\"string\"}}}"
    }
  }
}
```

:::
::::

## Error response

::::{div} mo-api-split
:::{div} mo-api-split-main

```{raw} html
<dl class="mo-api-fields">
  <div class="mo-api-field"><dt><code>code</code><span class="mo-api-field__type">string</span></dt><dd>Error code.</dd></div>
  <div class="mo-api-field"><dt><code>msg</code><span class="mo-api-field__type">string</span></dt><dd>Readable error message.</dd></div>
  <div class="mo-api-field"><dt><code>data</code><span class="mo-api-field__type">null</span></dt><dd>`null` in an error response.</dd></div>
</dl>
```

:::
:::{div} mo-api-split-aside

```{raw} html
<p class="mo-api-example-label">Error response example</p>
```

```json
{
  "code": "ErrParamInvalid",
  "msg": "请求参数无效",
  "data": null
}
```

:::
::::

## Follow-up operations

When the published content needs to be changed, [publish the operator API service](publish-operator-api-service.md); when it needs to be deactivated, [deactivate the operator API service](disable-operator-api-service.md).
