Connect your website
Get your published documents onto your site with a Read key.
PMKIN is where you write. Your website is where people read. They meet in the middle at the delivery API: your site asks for published documents, and PMKIN hands them over, ready to render.
This page covers the part you do in the app. Whoever builds your site takes it from there with the developer docs.
How it works#
- Your website fetches content from PMKIN's delivery API, a GraphQL API at
https://content.pmkin.io/graphql. - It only sees published documents and their categories. Briefs, drafts, statuses and revisions stay inside PMKIN.
- Edits to a published document don't reach your site until you publish again. See Drafts.
- Each project has its own keys, so a key for your blog can never read your docs site.
Create a key for your website#
- Open API in the project sidebar, under Connect.
- Choose Create key.
- Give it a name, like "Marketing site".
- Pick Read, for websites that only display published content.
- Choose Create key.
- Copy the key and store it somewhere safe.
Warning: You won't be able to see the key again after you close the dialog. Lost it? Create a new one and revoke the old one.
The API page also shows the endpoint your site sends requests to, with a copy button.
Tip: Read & write keys are for agents and scripts that draft and update documents. Your website only needs Read.
Hand it to your site#
Your developer stores the key as an environment variable on the server, like PMKIN_API_KEY, and sends it with each request:
curl https://content.pmkin.io/graphql \
-H "Authorization: Bearer $PMKIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "{ documents(limit: 5) { title slug publishedAt } }"}'
Warning: Keep the key on the server or in your build. Don't put it in code that runs in the browser.
The developer quick start walks through the first request in five minutes. Then pick a framework guide:
Manage your keys#
The API keys list on the API page shows each key's name, when it was created, its access and when it was last used. A key that says "Never used" may be one nobody needs.
To revoke a key:
- Choose Revoke on the key.
- Confirm with Revoke key.
Anything that uses the key stops working. You can't undo this, but you can always create a new key.
Where to find your project's details#
Settings shows the Project ID and the Delivery API address, each with a copy button, in case your developer asks.