Security & Limits

Token Protection

An open mock URL is fine for local testing, but if you're sharing an endpoint more widely — a demo, a teammate, a CI pipeline — you might not want it callable by anyone who finds the link. Token protection requires a valid token on every request to the mock.

Enabling it

Turn on Token protection in the mock's Token protection panel. MockBase generates a token and shows it to you once — copy it now, since it isn't stored in a form that can be shown again later (only its hash is kept — see Security). If you lose it, rotate to get a new one (which immediately invalidates the old one).

Calling a protected mock

Send the token as either:

Authorization: Bearer <token>

or

X-Mock-Token: <token>

A request without a valid token is rejected before it ever reaches your routes' matching logic.

To test a protected mock without leaving the browser, add the header in the Try It panel's Headers section before sending.