API Key Regeneration

Rotate your Datastreamer API key

Overview

You can regenerate (rotate) the organization API key at any time. This generates a new key and invalidates the old one. Any services using the old key will stop working almost right away, so update them with the new key as soon as possible.

Via the Portal

  1. Log in to the Datastreamer Portal.
  2. Go to Keys & Secrets in the left sidebar.
  3. Find the key you want to regenerate in the API Keys table.
  4. Click the Regenerate button on that row.
  5. A confirmation dialog will appear.
  6. Click Regenerate to confirm, or Cancel to abort. The page will refresh and the new key will appear in the table. A success toast notification will confirm the operation.


Via cURL

Use the external REST endpoint directly with your current API key as the authentication header. The key you send is the one being rotated.

Endpoint

POST https://api.platform.datastreamer.io/api/users/keys/rotate

Authentication

Pass your current API key in the apikey header:

curl -X POST \
  -H "apikey: YOUR_CURRENT_API_KEY" \
  "https://api.platform.datastreamer.io/api/users/keys/rotate"

Success Response (200)

{
  "api_key": "ds_newkey_a1b2c3d4e5f6g7h8i9j0"
}

The api_key field contains your new key. Save it immediately, the old key is no longer valid.

Error Responses

StatusMeaning
400Invalid request
401The API key in the apikey header is invalid or expired
404No matching key found

Related: Block / Unblock an API Key

You can also temporarily disable (block) an API key without generating a new one. A blocked key will not authenticate until unblocked via the Portal.

curl -X POST \
  -H "apikey: YOUR_API_KEY" \
  "https://api.platform.datastreamer.io/api/users/keys/block"

Response (200):

{
  "current_blocked": true
}

Important Notes

  • Immediate rotation: After regeneration, the old key stops working instantly for most services. Update all services, scripts, and integrations that use the key right away.