Updated on 2025-11-27 GMT+08:00

Deleting a Service

Function

This API is used to delete a model service. You can delete your own services only.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer. Obtain its CLI example hcloud ModelArts DeleteService.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    modelarts:service:delete

    Write

    service *

    g:ResourceTag/<tag-key>

    -

    -

URI

DELETE /v1/{project_id}/services/{service_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID and Name.

service_id

Yes

String

Service ID. To delete multiple services in a batch, use commas (,) to separate multiple service_id values.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling the IAM API that is used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

The service is deleted.

None

Example Requests

The following shows how to delete the model service with ID xxxxxx.

DELETE https://endpoint/v1/{project_id}/services/xxxxxx

Example Responses

Status code: 200

The service is deleted.

{ }

Status Codes

Status Code

Description

200

The service is deleted.

Error Codes

See Error Codes.