Keep an endpoint private with a key
An endpoint can answer only callers who send its key. The key is shown once, when it is made.
Open Endpoint (API Maker)Steps
- Open the endpoint and go to Settings.
- Under Who can call it, choose Only with a key and press Save changes.
- Copy the key from the window that opens. It is shown only this once.
- Send it with every call as the header Authorization: Bearer followed by the key.
- Lost it, or think someone else has it? Tick Make a new key and save. The old key stops working at once.
Examples
With the key
curl -H "Authorization: Bearer ek_your_key" https://endpoint.ocalt.com/k2v8q0r4m7x1c9b3n6t5w2ya
What happens next
Calls without the key, or with a wrong one, get 401 and nothing runs.
Good to know
- Keep keys out of web pages: anyone can read a page's code. Call a private endpoint from a server, a script or an app.
- Only a fingerprint of the key is kept, so Ocalt cannot show it to you again.
Still stuck?
Tell us which step stopped you and what you saw on screen. We answer from Support.