Copy a Theme
/sites/management/api/v1/themes/{id}/copy
Copy a theme by providing a new theme name and optional description. Theme names are case sensitive and two themes cannot share the same name. Use only letters, numbers, hyphens, and underscores in theme names. Copying a theme also copies the theme folder, including all the theme artifacts.
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
- Contributor
- Downloader
To invoke this operation, the authenticated user or client application must have one of the following roles:
- CECDeveloperUser
- CECSitesAdministrator
- CECContentAdministrator
Asynchronous Processing
This operation supports both asynchronous and synchronous processing. The client can specify a preferred interaction mode by adding a Prefer
header with a value of respond-async
. The server may change an asynchronous request to synchronous so the client should be prepared to handle both cases. An accepted response will include a Location
header, which provides the location of a status resource that can be polled to obtain information about the asynchronous processing.
For more information about reading the status see Get the Progress of a Site Related Job.
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/copy
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.
201Created - Copy a Theme Specifying a Name and Description
Copy a theme specifying a new name and description for the copy.
Request
POST https://api.example.com/sites/management/api/v1/themes/{id}/copy
Request Body
{ "name": "LearnThemeCopy", "description": "A copy of the learn theme." }
202Accepted - Copy a Theme Specifying a Name and Description Asynchronously
Copy a theme specifying a new name and description for the copy asynchronously.
Request
POST https://api.example.com/sites/management/api/v1/themes/{id}/copy
Request Headers
Prefer=respond-async
Request Body
{ "name": "LearnThemeCopy", "description": "A copy of the learn theme." }
Client Error Response Examples
This operation responds with the following client error (4xx) responses, with exception details in the response body or reported through the asynchronous job. For a full list of response HTTP status codes and example bodies, consult the Response section of this operation.
400Bad Request - Invalid Theme Name
The provided theme name cannot be used because it contains characters or words that are not allowed. The reason the theme name is invalid will be reported in the error message.
Error Code
OCE-SITEMGMT-009052
Resolution - Remove Spaces
Change the theme name so that it does not contain spaces.
Resolution - Check Characters
Use only letters, numbers, hyphens, and underscores in theme names.
Where This Error Can be Returned
- This error can be returned in the response body.
- This error will not be returned in the asynchronous job status.
Exception Detail Fields
This error type includes the following fields/values in the response:
Field Name | Description |
themeName | Invalid theme name. |
reason | Reason the theme name is invalid. Valid values are:
|
For detailed information about this exception detail type, consult the InvalidThemeNameExceptionDetail 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": "Invalid Theme Name", "status": "400", "detail": "Theme name '{themeName}' cannot be used to create a theme.", "o:errorCode": "OCE-SITEMGMT-009052", "themeName": "CafeSupremoTheme", "reason": "tooLong" }
Introduced in release 19.4.1.
403Forbidden - Storage Limit Reached
Storage transfer limit has been reached. Billing limits have been set on the amount of storage available by the system administrator.
Error Code
OCE-SITEMGMT-009098
Resolution - Increase Storage Limit
Get a system administrator to increase the storage limit.
Where This Error Can be Returned
- This error can be returned in the response body.
- This error will not be returned in the asynchronous job status.
Exception Detail Fields
This error type includes the following fields/values in the response:
Field Name | Description |
used | Storage used, in GB. |
limit | Storage limit, in GB. |
For detailed information about this exception detail type, consult the StorageLimitReachedExceptionDetail 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": "Storage Limit Reached", "status": "403", "detail": "Storage limit has been reached.", "o:errorCode": "OCE-SITEMGMT-009098", "used": 1.23456789, "limit": 1.23456789 }
Introduced in release 20.3.1.
403Forbidden - Sites Administrator Role Required
The Sites Administrator role is required to create resources of this type.
Error Code
OCE-SITEMGMT-009140
Resolution - Change Sites System Settings
Creation of sites, templates, themes and components can be restricted to sites administrators. Update the Sites System settings to allow creation of sites resources of this type by non admin users.
Where This Error Can be Returned
- This error can be returned in the response body.
- This error can be returned in the asynchronous job status.
Exception Detail Fields
This error type includes the following fields/values in the response:
Field Name | Description |
resourceType | Resource type that can only be created by Sites Administrators. Valid values are:
|
name | Name of resource being created, if available. |
For detailed information about this exception detail type, consult the SitesAdminRoleRequiredExceptionDetail 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": "Sites Administrator Role Required", "status": "403", "detail": "The Sites Administrator role is required to create resources of this type.", "o:errorCode": "OCE-SITEMGMT-009140", "resourceType": "site", "name": "value" }
Introduced in release 22.5.2.
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.
Where This Error Can be Returned
- This error can be returned in the response body.
- This error will not be returned in the asynchronous job status.
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 Already Exists
A theme with the same name or identity already exists. Theme names and identities must be unique across all themes.
Error Code
OCE-SITEMGMT-009042
Resolution - Change the Theme Name
If clashing on name during a copy or rename, choose a different name.
Resolution - Change the Conflict Resolution Name
If clashing on name during an import, choose a different name for the theme conflict resolution.
Resolution - Change the Conflict Resolution Action
If clashing on identity during an import, change the theme conflict resolution type to overwrite
, create
, or skip
.
Where This Error Can be Returned
- This error can be returned in the response body.
- This error will not be returned in the asynchronous job status.
Exception Detail Fields
This error type includes the following fields/values in the response:
Field Name | Description |
theme | Duplicate theme. |
name | Duplicate name. |
itemGuid | Duplicate identity Guid. |
For detailed information about this exception detail type, consult the ThemeAlreadyExistsExceptionDetail 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 Already Exists", "status": "409", "detail": "A theme with the same name or identity already exists.", "o:errorCode": "OCE-SITEMGMT-009042", "theme": { "id": "FFA7758925559C7F6FC394910D5DDCD9211A3DB216EC" }, "name": "CafeSupremoTheme", "itemGuid": "value" }
Introduced in release 19.4.1.
409Conflict - Theme Deleted
The operation cannot be performed on a soft deleted theme. This error can only occur when the includeDeleted
query parameter set to true
Error Code
OCE-SITEMGMT-009062
Resolution - Restore Theme
Restore the theme and then try the operation again.
Where This Error Can be Returned
- This error can be returned in the response body.
- This error will not be returned in the asynchronous job status.
Exception Detail Fields
This error type includes the following fields/values in the response:
Field Name | Description |
theme | Theme that is soft deleted. |
For detailed information about this exception detail type, consult the ThemeDeletedExceptionDetail 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 Deleted", "status": "409", "detail": "The operation cannot be performed as the theme has been soft deleted.", "o:errorCode": "OCE-SITEMGMT-009062", "theme": { "id": "FFA7758925559C7F6FC394910D5DDCD9211A3DB216EC" } }
Introduced in release 19.4.1.
409Conflict - Theme Import In Progress
This error will occur when a theme is being copied or published, but at the same time it is being overwritten by a template import.
Error Code
OCE-SITEMGMT-009106
Resolution - Wait for Theme Import to Complete
Wait for the template import that is overwriting theme to complete and try again.
Where This Error Can be Returned
- This error can be returned in the response body.
- This error can be returned in the asynchronous job status.
Exception Detail Fields
This error type includes the following fields/values in the response:
Field Name | Description |
importedBy | Full name of the user that created the import job that is in progress. |
name | Theme name. |
For detailed information about this exception detail type, consult the ThemeImportInProgressExceptionDetail 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 Import In Progress", "status": "409", "detail": "Unable to access theme as it is in the progress of being re-imported.", "o:errorCode": "OCE-SITEMGMT-009106", "importedBy": "value", "name": "CafeSupremoTheme" }
Introduced in release 20.4.2.
Request
- application/json
-
id: string
Immutable identifier for the theme.
-
includeDeleted(optional): boolean
Resources that have been marked for deletion can be read, modified, and support extended operations as long this query parameter is set to
true
. When theincludeDeleted
query parameter is not sent then the response to read, modification, and extended operations will be identical to that which would be returned if the resource was permanently deleted.
-
Prefer(optional): string
Request asynchronous processing of the request using a
respond-async
header value.
Details about the copy.
object
-
description(optional):
string
Maximum Length:
1000
Optional description. There is no restriction on the contents of the description; it can be a single line or multiple lines with any characters.
Introduced in release 19.4.1. -
name:
string
Maximum Length:
255
Name of the theme.
Introduced in release 19.4.1.
{
"name":"LearnThemeCopy",
"description":"A copy of the learn theme."
}
Response
201 Response
202 Response
400 Response
-
allOf
InvalidThemeNameExceptionDetail
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
InvalidThemeNameExceptionDetail-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
-
reason(optional):
string
Reason the theme name is invalid.
Valid values are:
-
tooLong
- Name is too long -
invalidCharacters
- Name contains invalid characters -
startWithSpace
- Name starts with a space -
endWithSpace
- Name ends with a space -
internalWord
- Name is a restricted internal word -
empty
- Name is empty
-
-
themeName(optional):
string
Maximum Length:
255
Invalid theme name.
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":"Invalid Theme Name",
"status":"400",
"detail":"Theme name '{themeName}' cannot be used to create a theme.",
"o:errorCode":"OCE-SITEMGMT-009052",
"themeName":"CafeSupremoTheme",
"reason":"tooLong"
}
401 Response
403 Response
-
allOf
StorageLimitReachedExceptionDetail
Introduced in release 20.3.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
StorageLimitReachedExceptionDetail-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
-
limit(optional):
number(double)
Storage limit, in GB.
Introduced in release 20.3.1. -
used(optional):
number(double)
Storage used, in GB.
Introduced in release 20.3.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":"Storage Limit Reached",
"status":"403",
"detail":"Storage limit has been reached.",
"o:errorCode":"OCE-SITEMGMT-009098",
"used":1.23456789,
"limit":1.23456789
}
{
"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
"title":"Sites Administrator Role Required",
"status":"403",
"detail":"The Sites Administrator role is required to create resources of this type.",
"o:errorCode":"OCE-SITEMGMT-009140",
"resourceType":"site",
"name":"value"
}
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
ThemeAlreadyExistsExceptionDetail
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
ThemeAlreadyExistsExceptionDetail-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
-
itemGuid(optional):
string
Duplicate identity Guid.
Introduced in release 22.4.3. -
name(optional):
string
Maximum Length:
255
Duplicate name.
Introduced in release 22.4.3. -
theme(optional):
string
Duplicate theme.
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 Already Exists",
"status":"409",
"detail":"A theme with the same name or identity already exists.",
"o:errorCode":"OCE-SITEMGMT-009042",
"theme":{
"id":"FFA7758925559C7F6FC394910D5DDCD9211A3DB216EC"
},
"name":"CafeSupremoTheme",
"itemGuid":"value"
}
{
"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
"title":"Theme Deleted",
"status":"409",
"detail":"The operation cannot be performed as the theme has been soft deleted.",
"o:errorCode":"OCE-SITEMGMT-009062",
"theme":{
"id":"FFA7758925559C7F6FC394910D5DDCD9211A3DB216EC"
}
}
{
"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
"title":"Theme Import In Progress",
"status":"409",
"detail":"Unable to access theme as it is in the progress of being re-imported.",
"o:errorCode":"OCE-SITEMGMT-009106",
"importedBy":"value",
"name":"CafeSupremoTheme"
}