Aller au contenu
Essai gratuit de 7 jours
Français
Ouvrir dans Claude Poser des questions sur cette pageOuvrir dans ChatGPT Poser des questions sur cette page

Authentication

Send your API key in the X-SAMITA-API-KEY header, and understand what makes a key valid.

Ce contenu n’est pas encore disponible dans votre langue.

Every request must carry an API key. Create one first — see Create an API key.

Use either header. Both do the same thing.

HeaderExample
X-SAMITA-API-KEYX-SAMITA-API-KEY: sqt_your_key_here
AuthorizationAuthorization: Bearer sqt_your_key_here
Terminal window
curl https://quote.samita.io/api/public/v1/ping \
-H "X-SAMITA-API-KEY: sqt_your_key_here"

You do not need to say which store you mean. The key already identifies it.

The API refuses any request that carries an Origin header, which is what a browser adds to calls made from a web page. The error is cors_not_supported. Call the API from your server, a script or an automation tool, and keep the key out of anything customers can see.

On every request the API checks that:

  1. a key was sent, and it exists
  2. it has not been revoked
  3. it has not expired
  4. the store still has the app installed
  5. the store’s plan includes the Public API
  6. the key has the permission the endpoint needs

Revoking a key takes effect immediately.

If this failsStatusError code
No key sent401unauthorized
Unknown, revoked or expired key, or the app was uninstalled401invalid_api_key
Plan does not include the API403plan_upgrade_required
The API is not available for the store403not_available
Key lacks the permission403insufficient_scope
Request came from a browser403cors_not_supported

Each endpoint needs one permission, called a scope in responses:

ScopeShown in the app as
quotes:readQuotes — View
quotes:createQuotes — Create
quotes:updateQuotes — Update
quotes:deleteQuotes — Delete
form:readQuote form — View

A request without the right scope returns 403 insufficient_scope and names the missing permission. GET /ping needs no scope, so it works with any valid key.

Too many failed attempts from one IP address — 30 in a minute — return 429 rate_limited with a Retry-After header. Fix the key before retrying in a loop.

Cette page vous a-t-elle été utile ?