Skip to main content

1. Create a Developer API key

Open FirstSales settings and go to API. Create a key with the minimum scopes needed for your workflow. For a read-only campaign check, use:
campaigns:read
organizations:read
workspaces:read
Store the raw key immediately. FirstSales shows it only once.

2. Export the key

export FIRSTSALES_API_KEY="fs_..."
export FIRSTSALES_BASE_URL="https://api.app.firstsales.io"

3. Verify the active identity

firstsales whoami --json
Or use cURL:
curl "$FIRSTSALES_BASE_URL/api/v1/whoami" \
  -H "Authorization: Bearer $FIRSTSALES_API_KEY"

4. List workspaces

firstsales workspaces list --org org_123 --json

5. List campaigns

firstsales campaigns list --org org_123 --workspace ws_123 --json

6. Mutate safely

For retries, provide an idempotency key:
firstsales contacts create \
  --org org_123 \
  --workspace ws_123 \
  --data '{"email":"alex@example.com","firstName":"Alex"}' \
  --idempotency-key import-row-001 \
  --json