Soft Delete a Component

delete

/sites/management/api/v1/components/{id}

SINGULAR

Soft delete the component. The folder that corresponds to the soft-deleted component will be moved to the trash folder of the owner of the component. A component 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 Components

You cannot delete a component or layout if it is used by any template. site or site update, including templates, sites or updates in the trash.

Restoring a Deleted Component

A soft-deleted component can be restored by the owner or the user that deleted the component.

For more information, see Undelete a Soft-Deleted Component.

Permanently Deleting a Component

A soft-deleted component can be permanently deleted using a hard delete.

For more information, see Hard Delete a Component.

Path Alternative Identifiers

The default identifier for a Component resource is the Component Identifier. The Component resource supports alternative identifiers.

nameComponent Name

Instead of the component identifier, the component name can be used to uniquely identify a component in the resource path. The default resource path parameter for a component is the component identifier, but when working with components the human-readable component name is sometimes easier.

http://api.example.com/sites/management/api/v1/components/name:FooterBar

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 - Component Operation Forbidden

Your sharing role within the component does not allow you to perform the operation.

Error Code

OCE-SITEMGMT-009055

Resolution - Change the Sharing Role

Change the 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 NameDescription
componentComponent on which the operation is being performed.

For detailed information about this exception detail type, consult the ComponentOperationForbiddenExceptionDetail 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": "Component Operation Forbidden",
  "status": "403",
  "detail": "You do have a sharing role in this component, but your role does not allow you to use this operation.",
  "o:errorCode": "OCE-SITEMGMT-009055",
  "component": {
    "id": "F40B9BE3E69F6DC440559A1F033BB2482DB740ECB2D8"
  }
}

Introduced in release 19.4.1.

404Not Found - Component Not Found

The site component does not exist or has been deleted, or the authenticated user or client application does not have access to the component.

Error Code

OCE-SITEMGMT-009045

Resolution - Check Identifier

Check that the component identifier is valid.

Resolution - Check Membership

Check that the authenticated user is a member of the component.

Exception Detail Fields

This error type includes the following fields/values in the response:

Field NameDescription
componentComponent that does not exist or is not visible to the authenticated user.

For detailed information about this exception detail type, consult the ComponentNotFoundExceptionDetail 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": "Component Not Found",
  "status": "404",
  "detail": "Component does not exist or has been deleted, or the authenticated user or client application does not have access to the component.",
  "o:errorCode": "OCE-SITEMGMT-009045",
  "component": {
    "id": "F40B9BE3E69F6DC440559A1F033BB2482DB740ECB2D8"
  }
}

Introduced in release 19.4.1.

409Conflict - Component In Use

The component is in use by one or more sites, templates or asset types. and cannot be deleted.

Error Code

OCE-SITEMGMT-009057

Resolution - Hard Delete Site

Hard delete the site that is associated with the component.

Resolution - Hard Delete Template

Hard delete the template that is associated with the component.

Resolution - Remove Component Usage From the Template or Site

Remove the component from the site or template that is using the component.

Exception Detail Fields

This error type includes the following fields/values in the response:

Field NameDescription
componentComponent that cannot be deleted because it is in use.
templatesTemplates that use the component.
sitesSites that use the component.
usedBySite resources that are using the component.

For detailed information about this exception detail type, consult the ComponentInUseExceptionDetail 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": "Component In Use",
  "status": "409",
  "detail": "Component cannot be deleted because it is being used by one or more sites, templates or asset types.",
  "o:errorCode": "OCE-SITEMGMT-009057",
  "component": {
    "id": "F40B9BE3E69F6DC440559A1F033BB2482DB740ECB2D8"
  },
  "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"
        }
    ]
  }
}

Introduced in release 19.4.1.

Request

Path Parameters
Back to Top

Response

204 Response

No Content
Headers

400 Response

Bad Request

401 Response

Unauthorized

403 Response

Forbidden
Body ()
Root Schema : schema
Match All
Show Source
Nested Schema : ComponentOperationForbiddenExceptionDetail
Introduced in release 19.4.1.
Match All
Show Source
Nested Schema : ExceptionDetail
Type: 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.

Show Source
Nested Schema : ComponentOperationForbiddenExceptionDetail-allOf[1]
Type: object
Show Source
Nested Schema : o:errorDetails
Type: array

Multiple errors can be organized in a hierarchical structure.

Show Source
Nested Schema : items
Match All
Show Source
  • 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.

Example Response (Component Operation Forbidden)
{
    "type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
    "title":"Component Operation Forbidden",
    "status":"403",
    "detail":"You do have a sharing role in this component, but your role does not allow you to use this operation.",
    "o:errorCode":"OCE-SITEMGMT-009055",
    "component":{
        "id":"F40B9BE3E69F6DC440559A1F033BB2482DB740ECB2D8"
    }
}

404 Response

Not Found
Headers
Body ()
Root Schema : schema
Match All
Show Source
Nested Schema : ComponentNotFoundExceptionDetail
Introduced in release 19.4.1.
Match All
Show Source
Nested Schema : ExceptionDetail
Type: 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.

Show Source
Nested Schema : ComponentNotFoundExceptionDetail-allOf[1]
Type: object
Show Source
Nested Schema : o:errorDetails
Type: array

Multiple errors can be organized in a hierarchical structure.

Show Source
Nested Schema : items
Match All
Show Source
  • 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.

Example Response (Component Not Found)
{
    "type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
    "title":"Component Not Found",
    "status":"404",
    "detail":"Component does not exist or has been deleted, or the authenticated user or client application does not have access to the component.",
    "o:errorCode":"OCE-SITEMGMT-009045",
    "component":{
        "id":"F40B9BE3E69F6DC440559A1F033BB2482DB740ECB2D8"
    }
}

409 Response

Conflict
Body ()
Root Schema : schema
Match All
Show Source
Nested Schema : ComponentInUseExceptionDetail
Introduced in release 19.4.1.
Match All
Show Source
Nested Schema : ExceptionDetail
Type: 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.

Show Source
Nested Schema : ComponentInUseExceptionDetail-allOf[1]
Type: object
Show Source
Nested Schema : o:errorDetails
Type: array

Multiple errors can be organized in a hierarchical structure.

Show Source
Nested Schema : items
Match All
Show Source
  • 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.

Nested Schema : sites
Type: array

Sites that use the component.

Introduced in release 19.4.1.
Show Source
Nested Schema : templates
Type: array

Templates that use the component.

Introduced in release 19.4.1.
Show Source
Nested Schema : usedBy
Type: object

Site resources that are using the component.

Introduced in release 22.6.2.
Show Source
Nested Schema : sitePlans
Type: array

Site plans.

Introduced in release 23.6.1.
Show Source
Nested Schema : sites
Type: array

Sites

Introduced in release 22.6.2.
Show Source
Nested Schema : templates
Type: array

Templates

Introduced in release 22.6.2.
Show Source
Nested Schema : translationConnectors
Type: array

Translation connectors.

Introduced in release 22.8.2.
Show Source
Nested Schema : types
Type: array

Content Types.

Introduced in release 22.6.2.
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : items
Type: object
Show Source
  • Maximum Length: 242

    Site name

    Introduced in release 22.6.2.
  • Associated site resource.

    Introduced in release 22.6.2.
Nested Schema : items
Type: object
Show Source
  • Maximum Length: 242

    Template name

    Introduced in release 22.6.2.
  • Associated template resource.

    Introduced in release 22.6.2.
Nested Schema : items
Type: object
Show Source
  • Tranlsation connector name.

    Introduced in release 22.8.2.
Nested Schema : items
Type: object
Show Source
  • Content type name.

    Introduced in release 22.7.2.
  • Associated content type resource.

    Introduced in release 22.7.2.
Example Response (Component In Use)
{
    "type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
    "title":"Component In Use",
    "status":"409",
    "detail":"Component cannot be deleted because it is being used by one or more sites, templates or asset types.",
    "o:errorCode":"OCE-SITEMGMT-009057",
    "component":{
        "id":"F40B9BE3E69F6DC440559A1F033BB2482DB740ECB2D8"
    },
    "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"
            }
        ]
    }
}

413 Response

Payload Too Large

429 Response

Too Many Requests

500 Response

Internal Server Error

501 Response

Not Implemented

502 Response

Bad Gateway

503 Response

Service Unavailable

504 Response

Gateway Timeout
Back to Top