API basics

Check out this article to learn the basics of REST API.

The API URL

You can reach the REST API through two URLs. The first option is through our CDN, the second option is directly on the API.

Requests through the CDN are cached and are therefore always lightning fast. We recommend this URL for all front-end applications that retrieve and display content items: https://cdn.prepr.io/

If you want to create, update or delete content items via the API we recommend the direct URL: https://api.eu1.prepr.io/

The HTTP method

In general, the Hypertext Transfer Protocol (HTTP) is the underlying format that is used to structure requests and responses for effective communication between an application and a server.

To call the REST API, you will need to use the appropriate HTTP method with the application/json content type.

Errors and validation

The REST API will validate and execute all inputs and return a response in JSON format.

When a request contains a mistake, the API might return an error message in the response. Read more about possible statuses and errors.

Read after write consistency

When you get a successful response for a mutation request, changes are persisted in Prepr. It is important to note that some changes are not visible immediately after the update. If you fetch content with a GraphQL API request right after a mutation with the REST API, you might get back stale content. Because, when you create, delete or update content the request is distributed around the globe with a short delay. Check out the caching doc for more details.