API authentication
The API uses bearer tokens. You create a token as an API key in the dashboard and send it in the Authorization header of every request.
Create a key
Section titled “Create a key”- Sign in to the dashboard and open Settings, then API keys. Confirm your password if you are asked.
- Choose Create API key.
- Enter a name that says where the key will be used, for example
Website form ingest. The name can be up to 255 characters. - Select at least one scope. See Scopes.
- Create the key and copy the token straight away.
For the full dashboard walkthrough, including revoking keys, see API keys.
Send the token
Section titled “Send the token”Send the token in the Authorization header with the Bearer scheme.
Authorization: Bearer <your API key>curl https://api.pingdex.io/api/v1/leads \ --header "Authorization: Bearer $PINGDEX_API_KEY" \ --header "Accept: application/json"The token identifies your user and therefore your account. Every request runs in that account. There is no account header or account parameter.
Scopes
Section titled “Scopes”A key carries one or more scopes. Each endpoint requires one scope, and a token must include it.
| Scope | Description | Endpoints |
|---|---|---|
leads:ingest |
Ingest leads into the account. | POST /leads |
leads:read |
Read leads and delivery attempts for the account. | GET /leads, GET /leads/{lead}, GET /leads/{lead}/attempts |
campaigns:manage |
Manage campaigns for the account. | GET /campaigns, POST /campaigns, GET /campaigns/{campaign}, PUT and PATCH /campaigns/{campaign} |
providers:manage |
Manage providers for the account. | GET /providers, POST /providers, GET /providers/{provider}, PUT and PATCH /providers/{provider} |
Scopes are independent. In particular:
leads:ingestdoes not allow reading leads. A system that submits leads and polls for outcomes needs bothleads:ingestandleads:read.providers:managecan change where your leads are sent and can store buyer credentials. Give it only to systems that need it.- A key cannot be created with no scopes.
- You cannot edit the scopes of an existing key. Create a new key with the scopes you want, then revoke the old one.
Give each system its own key with the fewest scopes it needs. A public web form, for example, needs only leads:ingest.
Failed authentication
Section titled “Failed authentication”Authentication is checked before scope, and both are checked before the request body is validated.
401 Unauthenticated
Section titled “401 Unauthenticated”The request has no usable token. This happens when the header is missing, the token is malformed, the key has been revoked, or the key has expired.
{ "message": "Unauthenticated."}403 Forbidden
Section titled “403 Forbidden”The token is valid, but it does not include the scope the endpoint needs.
{ "message": "Invalid scope(s) provided."}The response does not name the missing scope. Check the scope table above for the endpoint you called.
# A key with only leads:ingest calling a read endpointcurl https://api.pingdex.io/api/v1/leads \ --include \ --header "Authorization: Bearer $INGEST_ONLY_KEY" \ --header "Accept: application/json"HTTP/2 403content-type: application/json
{"message":"Invalid scope(s) provided."}See Errors for every error shape.
Token lifetime
Section titled “Token lifetime”Keys last about one year from creation. The key list in the dashboard shows each key’s creation and expiry dates. When a key expires, requests that use it return 401 and the key disappears from the list.
To rotate a key without downtime:
- Create a new key with the same scopes.
- Deploy the new token to your system.
- Confirm requests succeed with the new token.
- Revoke the old key.
Revoking a key takes effect immediately and cannot be undone.
No OAuth application flow
Section titled “No OAuth application flow”Pingdex does not offer an OAuth application flow for customers. You cannot register an OAuth client, run an authorisation redirect, or request tokens on behalf of other Pingdex users. API keys created under Settings, API keys are the only way to authenticate against the customer API.
Each key acts as the user who created it, in that user’s account. If you build a product that serves several Pingdex accounts, each account’s owner creates a key in their own account and gives it to you.
The MCP server accepts the same tokens and scopes. See Connect a client.