Unpublishing, Suspending, and Restoring an API
Description
- Unpublishes an API. After the API is unpublished, its authorization will be canceled and the API cannot be called.
- Suspends a published API temporarily. After the API is suspended, its authorization will be retained. The API cannot be called during the suspension.
- Restores an API that has been suspended. After the API is restored, it can be called again.
- If you are not the reviewer, your request for restoring an API needs to be reviewed by the API reviewer.
- To unpublish or suspend an API, you must be the API reviewer.
- Before unpublishing or suspending an API, you need to reserve sufficient preparation time for authorized apps. You need to initiate a request at least two days in advance. If you need to unpublish or suspend an API immediately, your requested action will be taken only after all apps finish processing messages.
URL
- URI format
POST /v1/{project_id}/service/apis/{api_id}/instances/{instance_id}/action
- Parameter description
Parameter
Mandatory
Type
Description
project_id
Yes
String
Project ID. For details about how to obtain the project ID, see Project ID and Account ID.
api_id
Yes
String
API ID
instance_id
Yes
String
Cluster ID
Request Message
- Example request
{ "action": "STOP", "time": "2021-01-01T10:00:00.000Z" }
- Request parameter description
Parameter
Mandatory
Type
Description
action
Yes
String
Operation type. Available values include:
UNPUBLISH: unpublishing an API
STOP: suspending an API
RECOVER: restoring an API
time
Yes
String
End time, in ISO format (+0 time zone). This parameter is required only for unpublishing or suspending an API and is accurate to hour.
Status Code
Status Code |
Description |
---|---|
204 |
The API operation is successful. |
For details about status codes, see Status Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.