Skip to content
TrackPin developers

API reference

Rotate key

POST/v1/keys/rotate

Swap your key for a new one. The old key stops working at once.

Not meteredTry it

Response

A JSON object.

  • keystring

    Your new key. It is in this response and nowhere else: we keep only a hash, so store it now.

  • key_prefixstring

    The first characters of the new key, for identification.

  • planone offreeprobusiness

    The new key's plan: the same as the old key's.

  • previous_key_prefixstring

    The first characters of the key that just stopped working.

Notes

  • Send the key you want to replace in x-api-key, with no body. Use it when a key may have leaked, or to retire one on a schedule.
  • The old key stops working as soon as this succeeds, so update everything that uses it. If the response is lost on the way, the old key is already gone: sign in to your account on trackpin.co to reset the key again.
  • The new key keeps the old key's plan, its subscription and today's usage.
  • At most 5 rotations a day, counted across a key and the keys it was rotated into.
  • Not metered. It shares the /v1/usage per-minute ceiling of 60 calls a minute.
  • Keys issued through RapidAPI are managed in your RapidAPI dashboard and can't be rotated here.

Errors

  • 401missing api key

    No key sent.

  • 401invalid api key

    Unknown or revoked key.

  • 403keys issued through RapidAPI are managed in your RapidAPI dashboard

    A RapidAPI key.

  • 405method not allowed

    Not a POST. The Allow header lists the methods it answers: POST and OPTIONS.

  • 409this key was just rotated or revoked

    Another rotation of the same key won the race. Use the key that one returned.

  • 429a key can be rotated at most 5 times a day

    The daily rotation limit is used up.

  • 429rate limit exceeded

    More than 60 calls a minute; wait Retry-After seconds. The body adds limit, window_s and retry_after_s.

  • 500internal error

    Something failed on our side. Check with /v1/usage which key works before retrying.

  • 503key rotation is unavailable right now

    Rotation is switched off or can't reach its database. Your key is unchanged.

  • 503temporarily unavailable

    Our database can't be reached right now. Retry after the number of seconds in the Retry-After header.

Error bodies are {"error": string}. See Errors and Quotas.

Try it

Rotating from this page would replace your key in the browser, so there's no console here. Reset a key from the usage page, which shows the new key once, or from your account if you bought it by card.

Early access.

Free keys are emailed straight away; Pro and Business are bought by card through Stripe. Request an API key