logo
logo

Preview API

The Preview API is a GraphQL API that exposes a preview of your content. It is optimized for live access of the latest data. Use the Preview API to access all content that is not approved yet, including drafts. The Preview API is useful to test content in a staging environment before going to production.

Warning

For production cases, use the Delivery API, not the Preview API. The Preview API is not scaled enough to handle high traffic.

Base URL

The base URL of the Preview API is:

{ContentHubURL}/api/graphql

Where {ContentHubURL} is your Content Hub instance URL.

IDE

The URL of the IDE of the Preview API is:

{ContentHubURL}/api/graphql/preview/ide

Where {ContentHubURL} is your Content Hub instance URL.

Endpoints

The Preview API exposes a single endpoint:

EndpointHTTP Verb
{ContentHubURL}/api/graphql/preview/v1POST

Headers

You need to authenticate with an API key for all requests to the Preview API.

NameFormatPurpose
X-GQL-TokenAPI keyAPI key generated using the Token API.

Request body

The body of the request is a GraphQL query.

Response format

The response of the request is a GraphQL-formatted response.

Can we improve this article ? Provide feedback