Pluma
Docs index
docs/errors/key_cannot.md View markdown →

key_cannot

HTTP 403 · This key cannot do that.

Why it happens

Each key type has fixed permissions: delivery reads published content, preview reads drafts, management can also write.

An agent can also do only what the person who connected it can: their role, and, if an owner limited them, only some content types or entries. Then the message says what's allowed, like You can only change entries of Event (event).

Raw code has its own rules (Who can change code): writing site-wide code or a code field needs manage_code (details.needs: "manage_code"), and publishing new code needs a person with it (details.needs: "person_with_manage_code", with the dashboard page in details.publish_in).

How to fix it

To write you need a management key. To read drafts, a preview key. See the key types in the API docs. If the message says what you can change, work inside that, or ask an owner or admin to widen the person's access in Team. For code, follow the fix: an owner gives code permission in Team (and Assistants for an agent), and a person publishes code in the dashboard.

Example

{
  "error": {
    "code": "key_cannot",
    "message": "This key cannot do that.",
    "fix": "To write you need a management key. To read drafts, a preview key. See the key types in the API docs.",
    "doc_url": "https://pluma.so/docs/errors/key_cannot"
  }
}