Content Management API

The Content Management API is a REST API that you can use to create, manage, and deliver content and media. This includes creating, updating, and deleting content types and content items as well as adding media items. Content types make up the content model while content items contain the data itself. The API definitions are written in JSON.

Before you start working with the Content Management API, here are some important things to note.

Tip

An overview of how to use the Content Management API and the Media Upload API is available on the Discover Sitecore channel.

API development environment

You can use the Content Management API with the development tool of your choice such as Swagger or Postman.

Authentication

In the Content Management API, tokens are used for API security. To use the API, generate an OAuth client bearer token and use it to authenticate.

Locales

The only locale supported is "en-us".

Methods

The Content Management API supports the following methods:

MethodDescription
GETRetrieves a content type, content item, or media item using the ID. Retrieves a list of all content types, content items, or media items.
POSTCreates a content type, content item, or media item. Publishes content items and media items.
PUTUpdates a content type, content item, or media item.
DELETEDeletes content type, content item, or media item.

Endpoints

In the Content Management API, the following endpoints are available:

EndpointBase URLDescription
Content managementhttps://content-api.sitecorecloud.io/This endpoint is used when creating and editing content types, content items, and media items.
Media uploadhttps://mms-upload.sitecorecloud.ioThis endpoint is used when uploading media assets.
Media deliveryhttps://mms-delivery.sitecorecloud.ioThis endpoint is used when retrieving media assets.

Endpoints are categorized as follows:

Endpoints have the following structure:

RequestResponseshell
https://{Base URL}/api/{data type}/{version}/{endpointName}/{pathParamenter}?{queryParameter}

Where:

  • {Base URL} is the hostname of the Content Hub ONE application backend, which is part of the endpoint.
  • {data type} is either content or media.
  • {version} is the version of the Content Management API.
  • {endpointName} is the name of the endpoint that covers one specific domain.
  • {pathParamenter} includes additional parameters from path.
  • {queryParameter} includes additional parameters from query string.

Request headers

The following header is used to track content versions.

RequestResponseshell
x-ch1-version

Reponse headers

All responses contain the following response headers:

RequestResponseshell
 access-control-allow-origin: * 
 api-supported-versions: 1.0 
 cache-control: no-store 
 cf-cache-status: DYNAMIC 
 cf-ray: 730eb8ff88d13ff1-YYZ 
 content-encoding: gzip 
 content-type: application/json; charset=utf-8 
 date: Tue,26 Jul 2022 17:05:53 GMT 
 expect-ct: max-age=604800,report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 
 server: cloudflare 
 strict-transport-security: max-age=15724800; includeSubDomains 

API rate limits

The following response headers show the allowed limits, the number of available requests, and the time remaining until the limits are reached.

HeaderDescription
viaThe software used for API rate limits, including the version.
x-kong-proxy-latencyProxy latency or overhead.
x-kong-upstream-latencyUpstream latency or overhead.
x-ratelimit-limit-secondThe maximum number of requests per second.
x-ratelimit-remaining-secondThe number of requests per second remaining.
Note

Content Hub ONE supports 10 requests per second per tenant.

Status codes

The following table lists the status codes that you might see after executing an operation:

Status codeMessageDescription
200OKContent item or media item was successfully retrieved or updated; or content type was successfully updated.
201CreatedContent type, content item, or media item was successfully created.
204No contentContent type, content item, or media item was successfully deleted.
400Bad requestInvalid query string, invalid object in request body, or invalid request.
401UnauthorizedInvalid access token.
403ForbiddenRequest does not contain required scopes.
404Not FoundContent type, content item, or media item was not found using the specified ID.
500Internal server errorServer-side exception during request execution.

Syntax

You do not need to understand the full syntax of the Content Management API before you begin, but we recommend you take an initial look at the data model now, and refer back to it again as required.

Note

For queries, you can use a pipe (|) to denote OR and an ampersand (&) to denote AND.

Do you have some feedback for us?

If you have suggestions for improving this article,