Skip to main content
All API requests (except /health) require authentication via an API key passed in the x-api-key request header.

Getting Your API Key

1

Navigate to settings

Go to Settings > API Keys in your PG:AI workspace.
2

Generate a key

Click Generate API Key, give it a descriptive name, and select the permission scopes it should have.
3

Copy and store securely

Copy the key immediately — it won’t be shown again. Store it in environment variables or a secrets manager.

Using Your API Key

Include the API key in the x-api-key header on every request:
curl -X GET "https://api.getpg.ai/public-api/v1/territories" \
  -H "x-api-key: your_api_key" \
  -H "Content-Type: application/json"
Never expose your API key in client-side code, public repositories, or browser requests. Always keep it server-side.

Base URL

All API endpoints use the following base URL:
https://api.getpg.ai/public-api/v1

Permissions & Scopes

API keys are scoped with granular permissions. Each endpoint requires a specific permission — requests made with a key that lacks the required scope will receive a 403 Forbidden response.
ScopeDescription
accounts:readSearch and list accounts
companies:readRead company data (relevance, graph, search, jobs, canvas)
contacts:readRead contact data
contacts:writeCreate or enrich contacts
insights:readRead company intelligence, profiles, alerts, and technologies
insights:writeCreate or modify company enrichment data
integrations:readRead integration status
jobs:readRead job postings
monitoring:readRead monitoring events
monitoring:writeManage monitoring events
org_settings:readRead organization settings and credits
sequences:readRead sequences and templates
sequences:writeCreate or modify sequences
tasks:readRead tasks
tasks:writeCreate or modify tasks
territories:readRead territories and their companies
workflows:readRead workflows
workflows:executeTrigger workflow executions
*Full access (all permissions)
Wildcard scopes are also supported. For example, insights:* grants both insights:read and insights:write.

Rate Limits

API requests are rate-limited based on your plan. If you exceed the limit, the API returns a 429 Too Many Requests response.
HeaderDescription
X-RateLimit-LimitMaximum requests allowed per window
X-RateLimit-RemainingRequests remaining in current window
X-RateLimit-ResetUnix timestamp when the rate limit resets
If you’re hitting rate limits, consider batching requests or adding short delays between calls.

Error Responses

All error responses follow a consistent structured format. Every error includes a type, a machine-readable code, and a human-readable message. Some errors include a details object with additional context.
{
  "error": {
    "type": "validation_error",
    "code": "invalid_uuid",
    "message": "Not a valid UUID.",
    "details": {}
  }
}
All responses (including errors) include an X-Request-Id header you can use when contacting support to identify the specific request.
Status CodeDescription
400Bad Request — invalid parameters or missing required fields
401Unauthorized — missing or invalid API key
402Insufficient Credits — your organization has run out of credits for this operation
403Forbidden — API key lacks the required permission scope
404Not Found — the requested resource does not exist
429Rate Limited — too many requests, slow down and retry
500Internal Server Error — something went wrong on our end
503Service Unavailable — a downstream service is temporarily unreachable