1. Experience Edge APIs

Admin REST API

The Admin REST API serves two primary functions: managing Experience Edge configuration and webhooks.

Authorization and API access

For the base URL and authorization, see Authorization and API access options.

Time to live (TTL)

Time to live (TTL) determines the maximum duration that content and media items are retained in the Experience Edge cache. The TTL values for content (contentCacheTtl) and media items (mediaCacheTtl) are included as response parameters returned by several Admin REST API endpoints. The default value of both parameters is four hours:

json
{
    "contentCacheTtl": "04:00:00",
    "contentCacheAutoClear": true,
    "mediaCacheTtl": "04:00:00",
    "mediaCacheAutoClear": true,
    "tenantCacheAutoClear": true
}

To set or update TTL values, use a string with the following notation:

plaintext
"{days}.{hours}:{minutes}:{seconds}"

Examples:

  • "720.00:00:00" sets the value to 720 days.
  • "00:15:00" sets the value to 15 minutes.

Endpoints for managing Experience Edge configuration

GetSettings

Lists all available settings for an environment.

  • Route: https://edge.sitecorecloud.io/api/admin/v1/settings
  • HTTP verb: GET
  • Response format: The settings for the environment.
json
{
  "contentCacheTtl": "04:00:00",
  "contentCacheAutoClear": true,
  "mediaCacheTtl": "04:00:00",
  "mediaCacheAutoClear": true,
  "tenantCacheAutoClear": true
}

UpdateSettings

Updates all available settings for an environment.

  • Route: https://edge.sitecorecloud.io/api/admin/v1/settings
  • HTTP verb: PUT
  • Body format:
json
{
  "contentCacheTtl": "04:00:00",
  "contentCacheAutoClear": true,
  "mediaCacheTtl": "04:00:00",
  "mediaCacheAutoClear": true,
  "tenantCacheAutoClear": true
}
  • Response status code: Accepted (202)

PatchSettings

Updates a setting using a patch operation or multiple patch operations. This endpoint uses the JSON patch format for operations and content-type headers as specified in RFC 6902.

  • Route: https://edge.sitecorecloud.io/api/admin/v1/settings
  • HTTP verb: PATCH
  • Headers: Content-Type: application/json-patch+json
  • Body format: A settings operation. Only replace operations are allowed. For more information, see RFC 6902 section 4.3. The following example updates the contentcachettl setting to 15 minutes:
json
[
  {
    "op": "replace",
    "path": "/contentcacheautoclear",
    "value": true
  },
  {
    "op": "replace",
    "path": "/contentcachettl",
    "value": "00:15:00"
  }
]
  • Response format: The settings for the environment.
json
{
  "contentCacheTtl": "00:15:00",
  "contentCacheAutoClear": true,
  "mediaCacheTtl": "04:00:00",
  "mediaCacheAutoClear": true,
  "tenantCacheAutoClear": true
}
  • Response status code: OK (200)

ClearCacheForTenant

Clears the entire cache for a given environment.

  • Route: https://edge.sitecorecloud.io/api/admin/v1/cache
  • HTTP verb: DELETE
  • Response format: Accepted status code (202)

DeleteContent

Removes environment data from the data storage.

Danger

This action instantly wipes all environment data from Experience Edge and can impact live availability of content.

  • Route: https://edge.sitecorecloud.io/api/admin/v1/content
  • HTTP verb: DELETE
  • Response format: Accepted status code (202)

Endpoints for managing webhooks

CreateWebhook

Creates a new webhook.

Important

When creating a webhook, you must use an HTTPS URI. HTTP is not supported.

  • Route: https://edge.sitecorecloud.io/api/admin/v1/webhooks
  • HTTP verb: POST
  • Body format: A webhook structure. Refer to Webhook objects to learn more about the various JSON objects used within the webhooks endpoint of the Admin REST API.
json
{
  "label": "My new webhook",
  "uri": "https://www.mysite.com/hooks/edge-hook",
  "method": "POST",
  "headers": {
    "x-header": "bar"
  },
  "body": "{\"rebuild\":\"true\"}",
  "createdBy": "anco",
  "executionMode": "OnEnd"
}
  • Response format: A webhook structure. Refer to Webhook objects to learn more about the various JSON objects used within the webhooks endpoint of the Admin REST API.
json
{
  "id": "5678",
  "tenantId": "mysite-corp",
  "label": "webhook 29",
  "uri": "https://www.mysite.com/hooks/edge-hook",
  "method": "POST",
  "headers": {
    "x-header": "bar"
  },
  "body": "{\"rebuild\":\"true\"}",
  "createdBy": "anco",
  "created": "2021-03-26T10:44:04.6107312+00:00",
  "executionMode": "OnEnd"
}
  • Response header: Returns the location of the new webhook. Example location: https://edge.sitecorecloud.io/api/admin/v1/webhooks/12345
  • Response status code: Created (201)

ListWebhooks

Lists all webhooks for an environment.

  • Route: https://edge.sitecorecloud.io/api/admin/v1/webhooks
  • HTTP verb: GET
  • Example: https://edge.sitecorecloud.io/api/admin/v1/webhooks
  • Response format: An array of webhooks. Refer to Webhook objects to learn more about the various JSON objects used within the webhooks endpoint of the Admin REST API.
json
[
  {
    "id": "1234",
    "tenantId": "test-tenant",
    "label": "webhook 92",
    "uri": "https://localhost/",
    "method": "POST",
    "body": "This is my optional body content",
    "created": "2021-03-26T10:44:04.6107312+00:00"
  },
  {
    "id": "5678",
    "tenantId": "test-tenant",
    "label": "webhook 29",
    "uri": "https://localhost/",
    "method": "POST",
    "headers": {
      "x-header": "bar"
    },
    "createdBy": "anco",
    "created": "2021-03-26T10:44:04.6107312+00:00",
    "executionMode": "OnEnd"
  }
]

GetWebhookById

Gets a specific environment webhook by ID.

  • Route: https://edge.sitecorecloud.io/api/admin/v1/webhooks/<WEBHOOK_ID>
  • HTTP verb: GET
  • Example: https://edge.sitecorecloud.io/api/admin/v1/webhooks/789
  • Response format:
json
{
  "id": "789",
  "tenantId": "test-tenant",
  "label": "webhook 92",
  "uri": "https://localhost/",
  "method": "POST",
  "headers": {
    "x-header": "foo"
  },
  "body": "Optional body content",
  "createdBy": "adn",
  "created": "2021-03-26T10:44:04.6107312+00:00",
  "executionMode": "OnEnd"
}

UpdateWebhook

Updates an existing webhook.

  • Route: https://edge.sitecorecloud.io/api/admin/v1/webhooks/<WEBHOOK_ID>
  • HTTP verb: PUT
  • Body format: A webhook structure. Refer to Webhook objects to learn more about the various JSON objects used within the webhooks endpoint of the Admin REST API.
json
{
  "label": "webhook 29",
  "uri": "https://www.acme.com/hooks/edge-hook",
  "method": "GET",
  "headers": {
    "x-header": "bar"
  },
  "body": "{\"rebuild\":\"true\"}",
  "createdBy": "anco",
  "created": "2021-03-26T10:44:04.6107312+00:00",
  "executionMode": "OnEnd"
}
  • Response status code: No content (204)

DeleteWebhook

Deletes a specific webhook.

  • Route: https://edge.sitecorecloud.io/api/admin/v1/webhooks/<WEBHOOK_ID>
  • HTTP verb: DELETE
  • Example: https://edge.sitecorecloud.io/api/admin/v1/webhooks/1234
  • Response status: No content (204)
If you have suggestions for improving this article, let us know!