Ghost 5 "UNKNOWN_CONTENT_API_KEY"

Can content API key.

site: https://datascientyst.com/
ghost v - v5.22.10

Error:

GET
	https://datascientyst.com/ghost/api/content/newsletters/?key=XXXXX&limit=all
Status
401
Unauthorized
VersionHTTP/3
Transferred1.09 kB (234 B size)
Request PriorityHighest

I did migration from one server to another.
The old MySQL database was used - in order to keep information for comments, members etc.

  1. Is it possible to change/ reset the content API key(s) from the UI or ghost setup?

I can see multiple different API keys in the old DB.
Only 2 in the new one.

  1. How can I check is it related to cache issue?

The problem was related to:

  • cache

After clearing cache for: /members/api/member/ all works fine now.

1 Like

Glad you got it sorted!

1 Like

running https://localhost:3333/api/ghost/post/update locally gives

Error: Unknown Content API Key
at /Users/nik … i/cjs/content-api.js:271:37

my env uses the exact content key at our ghost server

@Nikos In the future, it’d be better to make a new post to ask a question.

However, from the info you provided:

  • The endpoint isn’t right. You need to specify which API you’re trying to hit
    https://{admin_domain}/ghost/api/admin/ or https://{admin_domain}/ghost/api/content/
  • That being said, the Content API key will only work with the content API, but you need to use the Admin API to update posts.