Help topics

Connect a separate website or app to Morphic

Point a separate website or app at your Morphic content so it can load entries over the REST API.

Before you start

  • You need the Administrator role to create API keys.
  • At least one model must give See entries access to Everyone, or you need an API key for private content.

Copy the API address

  1. Go to API & integration.
  2. Copy the address next to REST API.

Allow public reads

If your content is public, use this section. Otherwise, go to the next section.

  1. Go to a model's Access tab.
  2. In the See entries row, select the checkbox in the Everyone column.

Create a key for private content

If your content is private, create an API key.

  1. Go to Settings > API keys.
  2. Select New API key.
  3. In Name, enter Website.
  4. In Models, select the models the site needs.
  5. Leave the Can also create, edit and delete checkbox cleared, so the key only reads.
  6. Select Create key.
  7. Select Copy key.

Request an entry

  1. In your frontend, request an entry, for example GET https://example.com/wp-json/morphic/v1/items/book. Replace the base address with the one you copied.
  2. If the content is private, send the key in the X-Morphic-Key header.

Result

The response has status 200 and lists the entries as JSON in items.

Caching

The API & integration screen shows a notice about the object cache. If the notice reads "No persistent object cache.", the app suggests installing Redis or Memcached with an object-cache drop-in.