Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

API Key Authorization doesn't work?

default discord avatar
nirenirat10 months ago
2

I'm trying to make requests through Postman to my Payload instance hosted on Payload Cloud following this doc -

https://payloadcms.com/docs/authentication/config#authenticating-via-api-key

But it doesn't work. I receive 403 error.



If I login via POSTing email & password to /api/users/login route and then send request (Postman appends cookie) - request is getting authorized and I receive data.

  • default discord avatar
    ritsu045510 months ago

    i cant see from this but did you include your users collection slug? the value of Authorization should be like this


    users API-Key XXXXXXXXXXXXXX
  • default discord avatar
    nirenirat10 months ago

    OMG. Thank you! From the doc I thought I'm supposed to include slug of user (id) to whom API Key belongs.

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.