GiftingStack
Sign in Get started
Docs menu

Docs

Authentication

Two kinds of credential, one header. A secret key lives on your server. A client token lives in your app and acts for one user.

Checked against the API and the live OpenAPI on 2026-10-21.

The base URL

There is one base URL: https://api.giftingstack.com. The environment (live or test) is chosen by the key you send, not by the host.

The two credentials

Secret keyClient token
Looks likegs_live_… or gs_test_…, then 32 letters and digitsgs_ct_…
Lives inYour server only. Never in an app, a web page or a repository.Your app. Safe to ship to the user's device.
CreatedIn the dashboard (API keys). Shown once.By your server, with POST /v1/client-tokens.
Endpoints/v1/*/v1/client/* only
Can doEverything in the API for your project and that environment.Read the catalog and its own balance, read received gifts, leaderboards and walls, send a gift as its own user. Never credit or debit.
LifetimeUntil you revoke it, or until its expiry date if you set one when creating it.60 seconds to 24 hours, one hour by default.

A secret key sent to a /v1/client/* endpoint is refused on purpose, and a client token sent to /v1/* is not a valid key. See Client tokens for minting, refreshing and revoking.

The header

Send the credential as a bearer token on every request:

curl https://api.giftingstack.com/v1/gifts \
  -H "Authorization: Bearer $GS_KEY"

Requests with a body use Content-Type: application/json and are limited to 16 KB (413 payload_too_large). The endpoints that move coins also need an Idempotency-Key header: see Idempotency.

Headers you get back:

HeaderWhenMeaning
X-Request-IdEvery responseThe id of this request. Quote it when you contact support. The same id is in the error body as request_id.
Idempotent-Replayed: trueA replayed requestThe answer is the stored one from the first call.
Retry-After429, and some 503Seconds to wait before you try again.
WWW-Authenticate401Tells the client which kind of bearer credential the endpoint expects.

Keys

  • Create and revoke keys in the dashboard, under your project, API keys. The key is shown once. GiftingStack stores only its SHA-256 hash, so a lost key cannot be recovered: create a new one.
  • There is no API to create keys. To rotate: create a new key, deploy it, then revoke the old one.
  • Revoking a key, or the key expiring, takes effect within about 30 seconds (keys are cached for 30 seconds). Revoking a key also ends every client token it minted.
  • Keep keys out of logs and source control. If a key leaks, revoke it first, then look at the ledger of the affected users.

Live and test

Each project has two separate environments. A gs_test_ key only ever sees test data, a gs_live_ key only live data. They have their own users, balances, gift catalog, ledger and events, and they never mix.

TestLive
Plan neededEvery plan, including the free Test planStarter or above. Creating a live key on the Test plan is refused with 403 plan_required in the dashboard, and a live key on the Test plan can only read (it can still delete users, change leaderboard visibility and revoke client tokens). Only the project owner creates live keys.
Limits50 users and 5,000 operations a month. See Rate limits.No such caps. A request limit per project environment that follows your plan.
Can be suspendedNeverYes, under the rules in the Terms (section 11). See Errors.

When authentication fails

StatustypeCauseWhat to do
401invalid_api_keyNo Authorization header, not Bearer <key>, a client token, an unknown or malformed key, a revoked or expired key, or the project is scheduled for deletion. The message says which.Check the key and the environment. Do not retry the same request.
401invalid_client_tokenOn /v1/client/*: missing, malformed or expired token, a secret key sent by mistake, a revoked token, or the key that minted it is no longer valid.Mint a new token on your server and retry once.
403project_suspendedThe live environment is suspended. For a secret key, details.reason says why; a client token gets only "This app is temporarily unavailable.", never the reason.Contact support@giftingstack.com.
429rate_limitedToo many requests, or too many failed authentications from one IP address (valid credentials never count against the IP limit).Wait Retry-After seconds. See Rate limits.

Questions or something unclear? support@giftingstack.com.