Keys / Contentful

CONTENTFUL_ACCESS_TOKEN

A Contentful token: a personal access token for the Content Management API, or a Delivery API key that reads published content.

Expires
you choose for personal tokens, or never
API
create, list and revoke personal tokens; create and delete Delivery keys

Get it

Create one on app.contentful.com. The steps aren't recorded yet.

Set it

CONTENTFUL_ACCESS_TOKEN=...

Contentful's @contentful/app-scripts reads it as a management token. The contentful and contentful-management SDKs don't; your app passes it as accessToken. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. For a personal access token, open Settings > CMA tokens in a space and create a new one with the same scopes. For a Delivery API key, open Settings > API keys and create a key with access to the same environments. It comes with its own Preview key.
  2. Deploy it everywhere that reads CONTENTFUL_ACCESS_TOKEN. If anything uses the old Preview key, under any variable name, give it the new Preview key too. The old ones keep working in the meantime.
  3. Check that nothing still uses the old token or keys, then revoke the token or delete the key. Deleting a Delivery key also deletes its Preview key.

Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.

Sources, checked 2026-11-16