Skip to main content

Removing a site from Arc XP

Note

Do not change the default website to a new website.

We strongly advise against changing or deleting the default website after your sites are live. The default website is deeply integrated into multiple layers of your Arc XP environment, not just Site Service. Modifying the default website could result in critical system failures and severely disrupt your environment.

If your organization is new to Arc XP and has not yet published a significant amount of content, changing the default website may be less risky. However, we emphasize that this action could still cause significant issues.

If a change to your default website is absolutely necessary, contact Arc XP Customer Support.

During your time on Arc XP, it’s common to not expose some of the sites you create, typically the sites on Sandbox, and when that happens, you should delete them. To safely remove a site, you must first disconnect the site from all content. This article outlines how to find and remove those connections.

To remove a site from an organization, you must search for all references and remove them before deleting the sections and the site. You can either keep the content and remove the site references or delete the content. 

You can find and export all site references with a scan of Content API. Then, for each content-type, you must make requests to the matching APIs to remove the site reference. Alternatively, you can also remove the content. After you resolve all references, you can remove the sections and site itself, and you can create an ACS ticket with Arc XP to remove any internal configuration.

Scanning Content API

To find all references to a site, you must scan all the content within Arc XP. The scan should also contain both published and unpublished content, as content can be circulated but not published. 

To scan through all content within Arc XP without duplicates and to ensure you reached all content, you must use the /scan endpoint of Content API. The /scan endpoint is less performant, but it ensures a continuous pagination through all content.

Because you’re looking for multiple content types, you must use an Elastic Search query, which you add to the scan with the body parameter.

{
    "query": {
        "bool": {
            "must": {
                "term": {
                    "revision.published": "false"
                }
            },
            "minimum_should_match": 1,
            "should": [{
                    "match": { "type": "story" }
                },
                {
                    "match": { "type": "video" }
                },
                {
                    "match": { "type": "gallery" }
                }
            ]
        }
    }
}

Note

All published content also has an unpublished draft version. To include both published and unpublished content, you can scan only for draft content, as both states include the same references.

The first call to /scan returns a scroll ID as next. You must add the scroll ID to the next request as scrollId; otherwise, the next request is identical to the first.

Note

The returned scrollId is valid for only 60 seconds. After 60 seconds, the scan is reset. You must perform all requests in sequence and uninterrupted. The scan could be interrupted through rate limiting. To prevent any issues, include a wait period and re-attempt after an error is returned, and then space the requests with approximately five seconds in between.

Next, create a script that exports all IDs and its type into a file or database. You can perform this step however you prefer, independently of Arc XP. In the next step, you must treat each type differently, so a sort by type helps. Otherwise, the script must check for the type during runtime.

To lessen the load of the response, which would contain the full ANS, adding _sourceInclude=type limits the returned data to only three fields and minimizes the response size significantly.

Note

You cannot remove the geo field from the returned response.

A sample request to Content API (fill in the {Site to delete} placeholder): 

curl --request get \
  --header 'Authorization: Bearer <TOKEN>' \
  --url https://api.{{org}}.arcpublishing.com/content/v4/scan?body={"query":{"bool":{"must":{"term":{"revision.published":"false"}},"minimum_should_match":1,"should":[{"match":{"type":"video"}}]}}}&size=100&website={Site to delete}&_sourceInclude=type

Note

You cannot use the ANS received from this endpoint to update the content in a later step because this is the Content API ANS with all references inflated. This version is intended for rendering, not for internal content manipulation.

Updating Content

The following sections contain steps to maintain the content or move the content to another site from the site you want to delete. 

It is important to include logic to catch and log any locked stories to re-attempt them later. To prevent any rate limiting issues, the script should include a pause of five seconds between requests.

Story

For each content item of type story, you must de-circulate and re-migrate the story with updated ANS without the site reference. You must perform this task through the Draft API.

Draft API has a specific endpoint to de-circulate a single content for a specific site. Fill in the {Arc UUID from scan} and {Site to delete} placeholders. 

curl --request DELETE \
  --header 'Authorization: Bearer <TOKEN>' \
  --url https://api.{{org}}.arcpublishing.com/draft/v1/story/{Arc UUID from scan}/circulation/{Site to delete}

Then get the current revision, update it locally, and upload a new revision for your story as outlined in How To Restore A Document From An Older Revision. Instead of updating the headline.basic as outlined in the document, process all changes outlined in Common ANS updates

If the story should be unpublished, send a request using this example, filling in the {Arc UUID from scan} placeholder.

curl --request DELETE \
  --header 'Authorization: Bearer <TOKEN>' \
  --url https://api.{{org}}.arcpublishing.com/draft/v1/story/{Arc UUID from scan}/revision/published

Note

To not overwhelm Draft API, to prevent a large number of simultaneous cache-busting requests, and to prevent any negative impact to the live environment, you must add the Arc-Priority: ingestion header.

Gallery

For each content item of type gallery, you must re-migrate the gallery with updated ANS without the site reference. You must perform this task through the Photo API

To get the full ANS for a gallery, make the following call to Photo API, filling in the {Arc UUID from scan} placeholder:

curl --request GET \
  --header 'Authorization: Bearer <TOKEN>' \
  --url https://api.{{org}}.arcpublishing.com/photo/api/v2/galleries/{Arc UUID from scan}

To unpublish a gallery, send a request, filling in the {Arc UUID from scan} placeholder:

curl --request PUT \
  --header 'Authorization: Bearer <TOKEN>' \
  --url https://api.{{org}}.arcpublishing.com/photo/api/v2/galleries/{Arc UUID from scan}/unpublish

To upload the updated ANS, send a request with form-data, filling in the {Arc UUID from scan} placeholder:

curl --request PUT \
  --header 'Authorization: Bearer <TOKEN>' \
  --header 'Content-Type: multipart/form-data' \
  --url https://api.{{org}}.arcpublishing.com/photo/api/v2/galleries/{Arc UUID from scan}
  --form 'ans={updated ANS}'

If the gallery was not unpublished in a previous step, republish the gallery to update the published ANS in Content API by sending a request, filling in the {Arc UUID from scan} placeholder:

curl --request PUT \
  --header 'Authorization: Bearer <TOKEN>' \
  --url https://api.{{org}}.arcpublishing.com/photo/api/v2/galleries/{Arc UUID from scan}/publish

Common ANS updates

The ANS can contain multiple references to the site. You must remove each reference to disconnect the site from the ANS. The following fields apply for story, gallery, and video: 

  • canonical_website

  • websites.{Site ID}

Draft API takes care of the following fields in a Story, but you still have to update them for gallery and video:

  • taxonomy.primary_site

  • taxonomy.primary_section

  • taxonomy.sites

  • taxonomy.sections

Note

Some references might be legacy entries and present only for longer-tenured clients. Arc XP no longer uses the legacy fields, taxonomy.primary_site and taxonomy.sites, but they might appear in your custom code. In the following steps, we expect those fields to be unused.

To update the returned ANS to remove all references to the site and its sections, follow these steps: 

  1. If canonical_website matches the site to delete:

    • replace the canonical_website field with an appropriate alternative site ID

    • Gallery/Video:

      • remove the taxonomy.primary_site and taxonomy.sites legacy fields

      • replace the taxonomy.primary_section field with an appropriate alternative from the alternative site ID

  2. Gallery/Video: Remove any entries in taxonomy.sections in which referent.website or _website matches the site to delete. If you changed the taxonomy.primary_section, add the same reference to taxonomy.sections.

  3. Remove the entry in websites with the key of the site to delete.

    • Gallery/Video: If it is the only key on websites, either unpublish the content after submitting the changed ANS or provide an appropriate alternative from the alternative site ID.

    • Story: Due to the de-circulation step, this is already removed for all stories. If there is no key on websites as a result, either unpublish the content afterward or provide an appropriate alternative from the alternative site ID.

Video

You can delete a video through Video Center or through the Video Center API.

Deleting Content

The following sections contain steps to remove the content from the site to delete from the environment. 

Note

Be aware that the delete operations outlined in this section are final and irreversible.

Story

To delete a story, follow the steps in Draft API: Deleting a Document.

Gallery

To delete a gallery, use the following steps. 

Create a request to the Photo API, as follows, filling in the {Arc UUID from scan} placeholder:

curl --request DELETE \
  --header 'Authorization: Bearer <TOKEN>' \
  --url https://api.{{org}}.arcpublishing.com/photo/api/v2/galleries/{Arc UUID from scan}

Video

It is currently not possible to delete a video through the API. You must delete all videos through Arc XP’s UI with the delete button under the Advanced section or by creating an ACS ticket with Arc XP containing the IDs of videos to delete.

Hybrid Content

If the site to delete is being used for both unique content for the site that should be deleted and shared content that should be maintained, we recommend a hybrid script with the steps from both Updating and Deleting content.

To check if content is circulated to more than one site, check the websites object. Each entry of websites is matching the circulation to one site. 

Redirects

As outlined in Decirculating: Removing the Canonical URL, de-circulating does not remove the redirects. They have to be individually removed through Draft API.

Story

First, get a list of all redirects for a story by making a request, filling in both the {Arc UUID from scan} and {Site to delete} placeholders:

curl --request GET \
  --header 'Authorization: Bearer <TOKEN>' \
  --url https://api.{{org}}.arcpublishing.com/draft/v1/story/{Arc UUID from scan}/redirect/{Site to delete}

Then for each returned redirect, create a request to delete the redirect with each given website_url from the individual objects, filling in the {Site to delete} and {website_url} placeholders:

curl --request DELETE \
  --header 'Authorization: Bearer <TOKEN>' \
  --url https://api.{{org}}.arcpublishing.com/draft/v1/redirect/{Site to delete}/{website_url}

Site Service

Now that the content is cleared of any references to the site, you can delete entries in Site Service. You must delete sections before deleting the site. You don’t need to remove hierarchies.

Sections

To delete sections, you have two options: using the UI or using the API; however, the outcome is different. If you delete sections through the UI, you can restore them through the UI later. If you delete them through the API, you delete them permanently.

Regardless of using the UI or API, you must delete all sections before deleting the site itself. 

UI

In the UI, you must empty all sections of their children before you can delete them. To have quick access to all sections, use the search functionality by entering a space ““ in the search on this link: 

https://{{org}}.arcpublishing.com/siteservice/#/site-service/website/{Site to delete}/sections

All deletable sections have the Delete options available on the right side, while sections with children do not display the Delete option.

rId28.png

The Delete option appears as soon as a section is without children, without re-triggering the search.

API

To delete through the API, you must first export all sections to get the section IDs. To get the section IDs, you can send a request to Site Service API.

From the following request, you need to export _id for every entry:

curl --request GET \
  --header 'Authorization: Bearer <TOKEN>' \
  --url https://api.{{org}}.arcpublishing.com/site/v3/website/{Site to delete}/section/

Then, for each _id, make a request to Site Service API to delete it:

curl --request DELETE \
  --header 'Authorization: Bearer <TOKEN>' \
  --url https://api.{{org}}.arcpublishing.com/site/v3/website/{Site to delete}/section/?_id={_id}

Note

Unlike the UI method, the API does not require you to delete the children before deleting the parent.

After you delete all sections, you can delete the site by making a request, filling in both the {org} and {Site to delete} placeholders:

curl --request DELETE \
  --header 'Authorization: Bearer <TOKEN>' \
  --url https://api.{{org}}.arcpublishing.com/site/v3/website/{Site to delete}

Delivery

After you delete all content references and Site Service entries and the site is fully provisioned on Arc XP, create an ACS ticket to remove any configurations in Arc XP.