About the Mutation API

Introduction

The Prepr Mutation API is a Content Management REST API.

Contact [email protected] to get help implementing your application, or join our 👨‍💻 slack.

API Url

GET: https://api.eu1.prepr.io

Authentication

To access the Prepr API you first need to authenticate your app with an OAuth bearer token.

A token provides scoped access to a single environment, you need to obtain another token for every new environment you want to access. Organizations with a Enterprise plan can create access tokens on the organization level.

We recommend using different access tokens for different applications or front end applications, for example, one for an iOS app and another for Android app. This allows you to revoke them individually in the future and manage access independently.

There are two ways to send the authentication token to an API. You can include it as a query parameter, access_token=$token, or as an HTTP header Authorization: Bearer $token. The header method is preferred.

curl -v https://api.eu1.prepr.io/{{endpoint}} -H 'Authorization: Bearer sdfg...'
curl -v https://api.eu1.prepr.io/{{endpoint}}?access_token=sdfg...

If you fail to include a valid access token, the endpoint will return a status code 401.

Rate limits

API Rate limits specify the number of requests an app can make to Prepr APIs in a specific time frame. Every request counts against a per minute and a per hour rate limit.

By default the Prepr API enforces rate limits of 50 requests per second, 3.000 per minute, and 20.000 requests per hour. Higher rate limits may apply depending on your current plan.

When a app gets rate limited, the API responds with the 429 Too Many Requests HTTP status code. Use the HTTP headers in order to understand where the application is at for a given rate limit, on the method that was just utilized.

header attributedescription
X-Prepr-RateLimit-Limitthe rate limit ceiling for a one minute window
X-Prepr-RateLimit-Remainingthe number of requests left for a one minute window
X-Prepr-Retry-Afterthe remaining seconds before the rate limit resets
X-Prepr-RateLimit-Resetthe remaining window before the rate limit resets, in UTC epoch seconds