Soft Delete a Theme
/sites/management/api/v1/themes/{id}
Soft delete the theme. The folder that corresponds to the soft-deleted theme will be moved to the trash folder of the owner of the theme. A theme that has been soft deleted can be restored or hard deleted.
Introduced in release 19.4.1.
Authorization
To invoke this operation, the authenticated user or client application must have been shared with the resource and have one of the following sharing roles:
- Owner
- Manager
In Use Themes
You cannot delete a theme if it is used by a template, site or site update, including templates, sites or updates in the trash.
Restoring a Deleted Theme
A soft-deleted theme can be restored by the owner or the user that deleted the theme.
For more information, see Undelete a Soft-Deleted Theme.
Permanently Deleting a Theme
A soft-deleted theme can be permanently deleted using a hard delete.
For more information, see Hard Delete a Theme.
Path Alternative Identifiers
The default identifier for a Theme resource is the Theme Identifier. The Theme resource supports alternative identifiers.
nameTheme Name
Instead of the theme identifier, the theme name can be used to uniquely identify a theme in the resource path. The default resource path parameter for a theme is the theme identifier, but when working with themes the human-readable theme name is sometimes easier.
http://api.example.com/sites/management/api/v1/themes/name:LearnTheme
Introduced in release 19.4.1.
Successful Response Examples
This operation responds with the following success (2xx) responses. For a full list of response HTTP status codes and example bodies, consult the Response section of this operation.
204No Content - Soft Deleted
When the resource is deleted a 204
status code is returned.
Client Error Response Examples
This operation responds with following client error (4xx) responses with exception details in the response body. For a full list of response HTTP status codes and example bodies, consult the Response section of this operation.
403Forbidden - Theme Operation Forbidden
Your sharing role within the theme does not allow you to perform the operation.
Error Code
OCE-SITEMGMT-009054
Resolution - Change the Sharing Role
Change the sharing role given to the authenticated user to the required role or higher.
Exception Detail Fields
This error type includes the following fields/values in the response:
Field Name | Description |
theme | Theme on which the operation is being performed. |
For detailed information about this exception detail type, consult the ThemeOperationForbiddenExceptionDetail schema in the definitions section of the swagger document.
Example Response Body
{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1", "title": "Theme Operation Forbidden", "status": "403", "detail": "You do have a sharing role in this theme, but your role does not allow you to use this operation.", "o:errorCode": "OCE-SITEMGMT-009054", "theme": { "id": "FFA7758925559C7F6FC394910D5DDCD9211A3DB216EC" } }
Introduced in release 19.4.1.
404Not Found - Theme Not Found
The site theme does not exist or has been deleted, or the authenticated user or client application does not have access to the theme.
Error Code
OCE-SITEMGMT-009041
Resolution - Check Identifier
Check that the theme identifier is valid.
Resolution - Check Membership
Check that the authenticated user is a member of the theme.
Exception Detail Fields
This error type includes the following fields/values in the response:
Field Name | Description |
theme | Theme that does not exist or is not visible to the authenticated user. |
For detailed information about this exception detail type, consult the ThemeNotFoundExceptionDetail schema in the definitions section of the swagger document.
Example Response Body
{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1", "title": "Theme Not Found", "status": "404", "detail": "Theme does not exist or has been deleted, or the authenticated user or client application does not have access to the theme.", "o:errorCode": "OCE-SITEMGMT-009041", "theme": { "id": "FFA7758925559C7F6FC394910D5DDCD9211A3DB216EC" } }
Introduced in release 19.4.1.
409Conflict - Theme In Use
The theme is in use by one of more sites or template and cannot be deleted.
Error Code
OCE-SITEMGMT-009056
Resolution - Hard Delete Site
Hard delete the site that is associated with the theme.
Resolution - Hard Delete Template
Hard delete the template that is associated with the theme.
Exception Detail Fields
This error type includes the following fields/values in the response:
Field Name | Description |
theme | Theme that cannot be deleted because it is in use. |
templates | Templates that use the theme. |
sites | Sites that use the theme. |
usedBy | Site resources that are using the theme. |
sitePlans | Site plans that use the theme. |
For detailed information about this exception detail type, consult the ThemeInUseExceptionDetail schema in the definitions section of the swagger document.
Example Response Body
{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1", "title": "Theme In Use", "status": "409", "detail": "Theme cannot be deleted because it is being used by one or more sites, site plans or templates.", "o:errorCode": "OCE-SITEMGMT-009056", "theme": { "id": "FFA7758925559C7F6FC394910D5DDCD9211A3DB216EC" }, "templates": [ { "id": "F30F08EB205D44AD20B5A48D1B1B3DD7D74F45978AB6" } ], "sites": [ { "id": "FCA9C0E5CDCB549A19FFB85987A2352778961003B8A0" } ], "usedBy": { "sites": [ { "name": "MyNewProduct", "site": { "id": "FCA9C0E5CDCB549A19FFB85987A2352778961003B8A0" } } ], "templates": [ { "name": "CafeSupremo", "template": { "id": "F30F08EB205D44AD20B5A48D1B1B3DD7D74F45978AB6" } } ], "types": [ { "name": "value", "type": { "name": "Video" } } ], "translationConnectors": [ { "name": "value" } ], "sitePlans": [ { "name": "value" } ] }, "sitePlans": [ "value" ] }
Introduced in release 19.4.1.
Request
-
id: string
Immutable identifier for the theme.
Response
204 Response
400 Response
401 Response
403 Response
-
allOf
ThemeOperationForbiddenExceptionDetail
Introduced in release 19.4.1.
-
object
ExceptionDetail
In addition to HTTP error code and error messages, it is often desirable to provide additional information to the client when a request fails. In such cases, the additional information will be included in the response body.
-
object
ThemeOperationForbiddenExceptionDetail-allOf[1]
object
In addition to HTTP error code and error messages, it is often desirable to provide additional information to the client when a request fails. In such cases, the additional information will be included in the response body.
-
detail(optional):
string
Description specific to this occurrence of the problem. The human-readable, potentially multi-line details describing the problem in more details.
-
instance(optional):
string(uri)
URI to the link that provides more detail about the error.
-
o:errorCode(optional):
string
Application error code, which is different from HTTP error code. This code should be used to check for specific errors, rather than comparing fields such as the
title
ordetail
. -
o:errorDetails(optional):
array o:errorDetails
Multiple errors can be organized in a hierarchical structure.
-
o:errorPath(optional):
string
XPath or JSON path to indicate where the error occurs.
-
status(optional):
integer(int32)
Corresponding HTTP status code for the error.
-
title(optional):
string
Short, human-readable summary of the problem. It is not advisable to use the title as a way of checking for specific errors, use the
o:errorCode
for this purpose. -
type(optional):
string(uri)
Absolute URI that identifies the problem type. When this URI dereferenced, it should provide a human-readable summary of the problem, for example, as a HTML page.
object
-
theme(optional):
string
Theme on which the operation is being performed.
Introduced in release 19.4.1.
array
Multiple errors can be organized in a hierarchical structure.
-
object
ExceptionDetail
In addition to HTTP error code and error messages, it is often desirable to provide additional information to the client when a request fails. In such cases, the additional information will be included in the response body.
{
"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
"title":"Theme Operation Forbidden",
"status":"403",
"detail":"You do have a sharing role in this theme, but your role does not allow you to use this operation.",
"o:errorCode":"OCE-SITEMGMT-009054",
"theme":{
"id":"FFA7758925559C7F6FC394910D5DDCD9211A3DB216EC"
}
}
404 Response
-
Cache-Control: string
Directives for caching mechanisms.
-
Content-Length: string
Size of the response body.
-
Content-Type: string
Content type of the response.
-
allOf
ThemeNotFoundExceptionDetail
Introduced in release 19.4.1.
-
object
ExceptionDetail
In addition to HTTP error code and error messages, it is often desirable to provide additional information to the client when a request fails. In such cases, the additional information will be included in the response body.
-
object
ThemeNotFoundExceptionDetail-allOf[1]
object
In addition to HTTP error code and error messages, it is often desirable to provide additional information to the client when a request fails. In such cases, the additional information will be included in the response body.
-
detail(optional):
string
Description specific to this occurrence of the problem. The human-readable, potentially multi-line details describing the problem in more details.
-
instance(optional):
string(uri)
URI to the link that provides more detail about the error.
-
o:errorCode(optional):
string
Application error code, which is different from HTTP error code. This code should be used to check for specific errors, rather than comparing fields such as the
title
ordetail
. -
o:errorDetails(optional):
array o:errorDetails
Multiple errors can be organized in a hierarchical structure.
-
o:errorPath(optional):
string
XPath or JSON path to indicate where the error occurs.
-
status(optional):
integer(int32)
Corresponding HTTP status code for the error.
-
title(optional):
string
Short, human-readable summary of the problem. It is not advisable to use the title as a way of checking for specific errors, use the
o:errorCode
for this purpose. -
type(optional):
string(uri)
Absolute URI that identifies the problem type. When this URI dereferenced, it should provide a human-readable summary of the problem, for example, as a HTML page.
object
-
theme(optional):
string
Theme that does not exist or is not visible to the authenticated user.
Introduced in release 19.4.1.
array
Multiple errors can be organized in a hierarchical structure.
-
object
ExceptionDetail
In addition to HTTP error code and error messages, it is often desirable to provide additional information to the client when a request fails. In such cases, the additional information will be included in the response body.
{
"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
"title":"Theme Not Found",
"status":"404",
"detail":"Theme does not exist or has been deleted, or the authenticated user or client application does not have access to the theme.",
"o:errorCode":"OCE-SITEMGMT-009041",
"theme":{
"id":"FFA7758925559C7F6FC394910D5DDCD9211A3DB216EC"
}
}
409 Response
-
allOf
ThemeInUseExceptionDetail
Introduced in release 19.4.1.
-
object
ExceptionDetail
In addition to HTTP error code and error messages, it is often desirable to provide additional information to the client when a request fails. In such cases, the additional information will be included in the response body.
-
object
ThemeInUseExceptionDetail-allOf[1]
object
In addition to HTTP error code and error messages, it is often desirable to provide additional information to the client when a request fails. In such cases, the additional information will be included in the response body.
-
detail(optional):
string
Description specific to this occurrence of the problem. The human-readable, potentially multi-line details describing the problem in more details.
-
instance(optional):
string(uri)
URI to the link that provides more detail about the error.
-
o:errorCode(optional):
string
Application error code, which is different from HTTP error code. This code should be used to check for specific errors, rather than comparing fields such as the
title
ordetail
. -
o:errorDetails(optional):
array o:errorDetails
Multiple errors can be organized in a hierarchical structure.
-
o:errorPath(optional):
string
XPath or JSON path to indicate where the error occurs.
-
status(optional):
integer(int32)
Corresponding HTTP status code for the error.
-
title(optional):
string
Short, human-readable summary of the problem. It is not advisable to use the title as a way of checking for specific errors, use the
o:errorCode
for this purpose. -
type(optional):
string(uri)
Absolute URI that identifies the problem type. When this URI dereferenced, it should provide a human-readable summary of the problem, for example, as a HTML page.
object
-
sitePlans(optional):
array sitePlans
Site plans that use the theme.
Introduced in release 23.6.1. -
sites(optional):
array sites
Sites that use the theme.
Introduced in release 19.4.1. -
templates(optional):
array templates
Templates that use the theme.
Introduced in release 19.4.1. -
theme(optional):
string
Theme that cannot be deleted because it is in use.
Introduced in release 19.4.1. -
usedBy(optional):
object usedBy
Site resources that are using the theme.
Introduced in release 22.6.2.
array
Multiple errors can be organized in a hierarchical structure.
-
object
ExceptionDetail
In addition to HTTP error code and error messages, it is often desirable to provide additional information to the client when a request fails. In such cases, the additional information will be included in the response body.
array
Site plans that use the theme.
Introduced in release 23.6.1.array
Sites that use the theme.
Introduced in release 19.4.1.array
Templates that use the theme.
Introduced in release 19.4.1.object
Site resources that are using the theme.
Introduced in release 22.6.2.-
sitePlans(optional):
array sitePlans
Site plans.
Introduced in release 23.6.1. -
sites(optional):
array sites
Sites
Introduced in release 22.6.2. -
templates(optional):
array templates
Templates
Introduced in release 22.6.2. -
translationConnectors(optional):
array translationConnectors
Translation connectors.
Introduced in release 22.8.2. -
types(optional):
array types
Content Types.
Introduced in release 22.6.2.
array
Translation connectors.
Introduced in release 22.8.2.object
-
name:
string
Site plan name.
Introduced in release 23.6.1.
object
-
name:
string
Maximum Length:
242
Site name
Introduced in release 22.6.2. -
site:
string
Associated site resource.
Introduced in release 22.6.2.
object
-
name:
string
Maximum Length:
242
Template name
Introduced in release 22.6.2. -
template:
string
Associated template resource.
Introduced in release 22.6.2.
object
-
name:
string
Tranlsation connector name.
Introduced in release 22.8.2.
object
-
name:
string
Content type name.
Introduced in release 22.7.2. -
type:
string
Associated content type resource.
Introduced in release 22.7.2.
{
"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
"title":"Theme In Use",
"status":"409",
"detail":"Theme cannot be deleted because it is being used by one or more sites, site plans or templates.",
"o:errorCode":"OCE-SITEMGMT-009056",
"theme":{
"id":"FFA7758925559C7F6FC394910D5DDCD9211A3DB216EC"
},
"templates":[
{
"id":"F30F08EB205D44AD20B5A48D1B1B3DD7D74F45978AB6"
}
],
"sites":[
{
"id":"FCA9C0E5CDCB549A19FFB85987A2352778961003B8A0"
}
],
"usedBy":{
"sites":[
{
"name":"MyNewProduct",
"site":{
"id":"FCA9C0E5CDCB549A19FFB85987A2352778961003B8A0"
}
}
],
"templates":[
{
"name":"CafeSupremo",
"template":{
"id":"F30F08EB205D44AD20B5A48D1B1B3DD7D74F45978AB6"
}
}
],
"types":[
{
"name":"value",
"type":{
"name":"Video"
}
}
],
"translationConnectors":[
{
"name":"value"
}
],
"sitePlans":[
{
"name":"value"
}
]
},
"sitePlans":[
"value"
]
}