Skip to docs content
Browse and search
On this page

Rotate a stream key

Replace an exposed stream key. The old key, and setup proofs issued for it, stop working at once; the response holds the new key once. A key alone can't rotate: send the setup proof from a recent email code. Not replayable: a retry with the old Standard key gets 401, so verify a new email code to read the key again.

POST/api/agent/credentials/rotate

Authorization

  • AuthorizationstringheaderrequiredBearer authentication with your TweetStream API key: Bearer <key>.

Headers

  • X-TweetStream-Setup-ProofstringheaderrequiredThe setupProof returned by email verification. It lasts 30 minutes; after that, verify a new email code.

Body

  • familyenum<string>required

Response fields

  • apiKeystringrequired
  • createdAtstringrequireda string to be decoded into a Date
  • credentialScopeenum<string>required
  • familyenum<string>required

Responses

  • 200Success
  • 400Invalid request, wrong code, or the Terms were not accepted
  • 401Missing or invalid API key, or the setup proof is missing or expired
  • 403The account is restricted, or the request carried a foreign Origin
  • 404No such checkout or link, or the account has no entitlement for this product
  • 429Rate limit or activation budget reached; retry after retryAfterSeconds
  • 503Temporarily unavailable; retry later