Keys
Four kinds of key, each able to do only what its place needs.
A project can have any number of keys. Create and delete them under Setup. A key is shown in full once, when it is made; after that only its last four characters are kept.
| Kind | Starts with | Can | Belongs |
|---|---|---|---|
| Private | sk_ |
Everything: post events, set insights, backfill, and read. | On a server, in a secret. |
| Public | pk_ |
Post events, identify, group, alias and page views, ask for an experiment’s variant and subscribe an address. Nothing else: unsubscribing and removing a subscriber take a private key. | In a web page or an app. |
| Read | rk_ |
Read. Nothing else. | In an export script, or an assistant’s config. |
| Manage | mk_ |
Read, and change the project through the MCP server: charts, A/B tests, keys, teammates, settings. It cannot post events. | In the config of an assistant you trust with the project. |
Public keys
Anyone who opens a page can read the key in it, so a public key is built to be harmless in the wrong hands:
- It cannot read anything.
- It cannot set or change insights.
- It cannot rewrite history. It can give an event a time within the last 7 days, so an app that was offline can catch up, and no further.
- It can be limited to named channels. A page that only sends feedback gets a key that can only post to
feedback. - It is held to 120 requests a minute from one address.
Read keys
A read key answers the read endpoints and the MCP server. It can be limited to channels too, and then it sees only those channels’ events, counts and funnels.
Manage keys and account keys
A manage key lets an assistant do in one project what its owner can do in the app, over the MCP server. Only the owner can make one, it cannot post events, and it cannot be limited to channels.
An account key, which starts with ak_, belongs to you and not to a project: it reaches every project you are on, with your rights in each, and can create projects. Make one under Setup, Connect an assistant. You can have up to 10, and deleting one cuts off whatever used it.
Replacing a key
Delete the old key and create a new one. A deleted key stops working at once.
Teammates
Under Setup, Sharing, the project’s owner makes an invitation link and sends it to a teammate, who joins by opening it and signing in. The link works for anyone who has it, so send it only to people you want on the project; the owner can turn it off or swap it for a new one, and whoever has already joined stays.
Everyone on a project sees it and gets its notifications. Only the project’s owner can create or delete keys, make the invitation link and remove people.
Limiting where keys are used from
Under Setup, Allowed senders, a project can list the sites its public keys may be used from and the addresses its private and read keys may be used from. Both lists start empty, which accepts requests from anywhere.
- Sites apply to public keys. Write one domain a line, such as
example.com; it also coverswww.example.comand its other subdomains. A request from a page on any other site is refused with a 403. - Addresses apply to private, read and manage keys, including the MCP server. Write one IP address or range a line, such as
203.0.113.7or203.0.113.0/24.
A site is what the browser reports, so the list keeps your key from being used on someone else’s pages; it does not stop a script that fakes the header.
Next Reading data