Unshare a custom image
Updated at:2025-10-20
This API allows users to stop sharing specified custom images.
- If the image ID specified in imageId does not exist, a 404 error is returned.
- Once an image is no longer shared, the user it was unshared from will no longer be able to use it to create or reset instances.
- In the request, the account and accountId parameters are optional but at least one must be provided. If both are included, duplicates will automatically be removed by the server.
Request structure
Plain Text
1POST /v{version}/image/{imageId}?{action} HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
4
5{
6 "account" : "account",
7 "accountId" : "accountId"
8}
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Whether required | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number |
| imageId | String | Yes | URL parameter | ID of image to be unshared |
| action | String | Yes | Query | Action performed on the image, current value: unshare |
| account | String | No | Request Body parameters | Name of user to be unshared |
| accountId | String | No | Request Body parameters | ID of user to be unshared |
| ucAccount | String | No | RequestBody | UC account |
Response headers
No special headers are required beyond the standard ones.
Response parameters
There are no special response parameters
Error codes
| Error code | Error description | HTTP status code | Chinese explanation |
|---|---|---|---|
| Image.UnCustomImageCannotBeShared | Only custom image can be shared. | 403 | Non-custom images cannot be shared |
| Image.InvalidAccount | Account is invalid. | 400 | Invalid user |
| Image.AccountListIsEmpty | Account list is empty. | 400 | The user list is empty |
Request example
Plain Text
1POST /v2/image/m-nky****?unshare HTTP/1.1
2Host: bcc.bj.baidubce.com
3ContentType: application/json
4Date: Wed, 01 Mar 2006 12:00:00 GMT
5Authorization: authorization-string
6
7{
8 "accountId" : "ab1d7802c************"
9}
Response example
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
3Date: Wed, 03 Dec 2014 06:42:19 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
