Manage DSN keys

Add a DSN key to a project, give it its own rate limit, and revoke a key so the ingest refuses it within seconds.

Last updated 18 November 2026View as Markdown

A DSN key only lets its holder send events, never read them, so it is safe in a browser bundle. Give each app or environment its own key when you want to revoke one without the others. Replace project-id with the project's id and key-id with the key's id.

Prerequisites

  • Permission for errors:UpdateProject on the project. Without it, the Setup tab says "Adding or revoking keys needs errors:UpdateProject."
  • In the console, also errors:ListProjects on the project to open it (without it the project is not found).

Add a key

A project has at most 20 active keys.

  1. Open the project, then the Setup tab.
  2. Under DSN keys, choose Add key.

The new key appears in the table, labelled Key and a number, with the project's rate limit. To give it a label or a rate limit of its own, use the CLI or the API.

409 "A project has at most 20 active keys" when the project has 20 already.

Revoke a key

Warning

SDKs still sending with a revoked key are refused with the message "unknown or revoked DSN key" (status 401) and drop their events without retrying. Events already received stay.

The key labelled Managed (connected apps and CI) is the one connected apps and CI environments use. To replace it, rotate it instead (see Rotate the managed key).

  1. Open the project, then the Setup tab.
  2. Under DSN keys, open the key's action menu and choose Revoke key.
  3. Choose Revoke.

Result

The ingest refuses a revoked key within seconds. A revoked key stays listed with its status, and the DSN in the project's header is the first active key's; with none left it reads "No active key".

Did this page help you?