Skip to content

Introduction

In this API Reference, find ways to deliver Cosmic content to your websites and apps using the APIs and available clients.

🚀

For a quick reference to get content from your Bucket, click the "Developer Tools" button found on select pages in your Bucket Dashboard .

API Access Keys

For read / write access to your content using the APIs and available clients, you will need to provide your Bucket slug and API access keys. Find your Bucket slug and API access keys after you log in to your Cosmic account and go to Your Bucket > Settings > API Access. (Screenshot for reference below)

image

Status Check

You can check on the API system status via the Cosmic status page and via the following endpoint:

https://api.cosmicjs.com/v2/status

Postman

We offer a Postman collection for a quick reference to review and interact with all Cosmic REST and GraphQL API endpoints. Follow the steps to install and configure below.

Install and configure

  1. Start by selecting between the REST or GraphQL API. Click the button below to install the collection.
  1. Click the dots then "Edit" option to get into the collection settings. (REST version shown below)

    Postman settings
  2. Edit your variables to match with your Cosmic user account and Bucket API access keys.

    Postman variables

Encode queries

If you are using Queries in Postman here's a handy way to encode your query param:

  1. Add your query as a param in your Postman request and select the input or right click: Encode Query Screenshot 1

  2. Click the three dots and select "Encode URI Component": Encode Query Screenshot 2

  3. See your query now encoded and ready to use: Encode Query Screenshot 3