Delete Global Element

Deletes a global element from a Square Online site. This operation permanently removes the specified section or container file from the site directory of the site.

DELETE /v2/sites/{site_id}/global-element?section|container={file_name}

Permissions: ONLINE_STORE_CUSTOM_THEME_WRITE

Path parameters

Name Type Description
site_id string Required The ID of the site.

Query parameters

Name Type Description
section string The name the global section file to delete (without the file extension). Either section or container is required.
container string The name of the global container file to delete (without the file extension). Either section or container is required.

Response fields

Name Type Description
errors Error [ ] Any errors that occurred during the request.

Example requests

Delete a section:

curl https://connect.squareup.com/v2/sites/site_id0/global-elements?section=section_file_name1 \
  -X DELETE \
  -H 'Square-Version: 2023-09-25' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json'

Delete a container:

curl https://connect.squareup.com/v2/sites/site_id0/global-elements?container=container_file_name1 \
  -X DELETE \
  -H 'Square-Version: 2023-09-25' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json'

Example response

{}