Authentication, scopes & plans
API keys
Send your key in one of three ways, accepted the same on every REST endpoint and on the WebSocket: Authorization: Bearer xsf_…, the X-API-Key header, or ?api_key= in the URL (meant for browsers, which cannot set headers on a WebSocket handshake). If you send more than one, Authorization is used first, then X-API-Key, then api_key. A key that does not exist and a key that has been revoked are told apart: invalid_api_key means check for a typo or an old secret, key_revoked means talk to whoever issued it.
Scopes
A key carries scopes. A call outside them returns 403 with {"error":{"code":"scope_required"}} naming the scope you lack. GET /v1/account lists yours; GET /v1/meta/scopes lists all of them.
| Scope | What it permits |
|---|---|
| targets:read | List the accounts this key monitors |
| targets:write | Add, change and remove monitored accounts, singly or in batches |
| keywords:read | List keywords and receive search.match events |
| keywords:write | Add and remove keywords |
| stream | Open the WebSocket |
| replay | Use last_id and GET /v1/events |
| webhook | Configure webhook delivery |
| reads | On-demand REST reads of profiles, posts, followers, following; costs credits |
Administrative scopes exist for our own operators and are served on a separate, private interface. A customer key can never carry one.
Plans
A plan is a preset of scopes and caps; any key can be adjusted individually. The live matrix is at GET /v1/meta/plans. Prices are not published here.
| Plan | Targets | Keywords | Connections | Requests / min | Scopes |
|---|---|---|---|---|---|
| starter | 50 | 0 | 2 | 300 | targets:read, targets:write, stream, replay, reads, webhook |
| pro | 200 | 20 | 5 | 600 | targets:read, targets:write, stream, replay, reads, webhook, keywords:read, keywords:write |
| scale | 1000 | 100 | 10 | 900 | targets:read, targets:write, keywords:read, keywords:write, stream, replay, webhook, reads |
| ultra | 2000 | 300 | 20 | 1200 | targets:read, targets:write, keywords:read, keywords:write, stream, replay, webhook, reads |