pgday.app developer API & agent guide

Build sales gamification integrations with pgday.app by Kuckein Consulting. Explore fictional records without an account, then use scoped credentials for authorised customer data.

Use the official pgday CLI

Install the official CLI through Homebrew on macOS or Linux; Homebrew supplies Node.js 24. Explore the sandbox without credentials, or use scoped production keys through the PGDAY_API_KEY environment variable. Commands return JSON and never automatically retry writes.

brew install kkuckein/pgday/pgday
pgday events list --sandbox
pgday spec --sandbox
CLI installation, commands and releases

Try the free API sandbox

No account, key or sales conversation is required. This read-only sandbox returns fixed fictional leads, events, statistics and leaderboards. Use IDs returned by these requests to explore details. Pagination and filters follow the read API contract; writes return HTTP 405. No customer data or external actions are involved.

curl https://www.pgday.app/api/sandbox/v1/events
curl 'https://www.pgday.app/api/sandbox/v1/leads?limit=1'

Connect an authorised organisation

Production is currently limited to pilot organisations. The configured 14-day Pro trial for five seats is not open for public self-service signup. Existing authorised managers with active API entitlement can create and revoke their own keys in Settings → Integrations, AI & plan.

Choose an organisation or one Space explicitly. Start with leads:read and add events:read, leaderboard:read or leads:write only when needed. The key is shown once. Store it in your secret manager; never paste it into chat, source code or URLs.

curl --fail-with-body \
  -H "Authorization: Bearer $PGDAY_API_KEY" \
  "https://pkoxxomkokniffvcjutm.supabase.co/functions/v1/pgday-api/leads?limit=10"
API key creation and lead-write rules

Recover from errors safely

Errors contain error.code, error.message and error.resolution. Check credentials for 401, permissions and entitlement for 403, request fields for 400, and resource visibility for 404. Respect Retry-After on 429. A 409 confirms rollback. If a write times out or returns 503, inspect existing leads before retrying: an unconfirmed create may already have succeeded.

Use the separate MCP OAuth connection

The analytics MCP server uses OAuth with PKCE, not API keys. Authorise analytics:read and optionally leads:read through the app. These read-only tools follow the authorising user’s visibility. The metadata links declare supported scopes and the actual resource URL.