The legacy automation.sayf.in/webhook/extractor endpoint is being sunset on 30Β JuneΒ 2026. Migrate to the v1 API on build.thepeakai.com documented below β same lookup types, new base URL + Bearer auth. /webhook/extractor on the new host is kept as a legacy alias of /api; new integrations should use /api.
Automation & API
Integrate PeakAI into your workflows with our REST API, hook into AI agents over MCP, or use our official n8n node for no-code automation.
Authentication
Get your access token to start making API calls
Every request needs a JWT access token β the same login you use for PeakAI. POST email + password to /token and you get back an access_token. Sign in once on the right and you can hit Run on any endpoint below to test live.
Your account needs API access enabled first β email studio@thepeakai.com to turn it on.
Base URL
https://build.thepeakai.comPass the access token as Authorization: Bearer <token> (preferred) β or as ?access_token=<token> as a fallback.
Access tokens are valid for 15 days (token_expires_in is the lifetime in seconds). Refresh by calling /token again before it expires β this endpoint is limited to 10 requests/min per IP. The caller's identity comes only from the verified token β never from request-body fields.
POST https://build.thepeakai.com/token
Content-Type: application/json
{
"email": "your@email.com",
"password": "yourpassword"
}
# Response (200)
{
"access_token": "eyJhbGciOiJSUzI1NiIs...",
"email": "your@email.com",
"token_expires_in": "1296000"
}
# Invalid credentials (404)
{ "response": "Invalid Login your@email.com . Please contact (studio@thepeakai.com) for new account." }API Endpoints
All extraction features use the same base endpoint with different type parameters.
Endpoints
Phone Number Lookup
Resolve personal phone numbers from a LinkedIn profile through the data-provider waterfall.
POST /api?type=phone_noParameters
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | header | Yes | Bearer <access_token> |
| type | query | Yes | "phone_no" |
| profile_url | string | Yes | Full LinkedIn profile URL |
Example Request
curl -X POST "https://build.thepeakai.com/api?type=phone_no&profile_url=https://linkedin.com/in/kunalbahl" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"Example Response
{
"linkedin_url": "https://www.linkedin.com/in/kunalbahl",
"from_cache": true,
"credits_charged": 9,
"credits_remaining": 26115,
"phone_no": ["919958006818"]
}Try It OutSign in above to run
Sample inputs are pre-filled β hit Run to call https://build.thepeakai.com/api?type=phone_no with your real token.
Code Examples
Quick start examples in popular languages
PyPython
import requests
PEAKAI_BASE = "https://build.thepeakai.com"
# Step 1: Sign in to get an access token (valid 15 days)
auth = requests.post(
f"{PEAKAI_BASE}/token",
json={"email": "your@email.com", "password": "yourpassword"},
timeout=30,
).json()
token = auth["access_token"]
# Step 2: Look up a phone number
res = requests.post(
f"{PEAKAI_BASE}/api",
params={
"type": "phone_no",
"profile_url": "https://linkedin.com/in/kunalbahl",
},
headers={"Authorization": f"Bearer {token}"},
timeout=90, # cold provider waterfall can take 30β60s
)
print(res.json())JSJavaScript (Node.js)
const PEAKAI_BASE = 'https://build.thepeakai.com';
async function lookupContact() {
// Step 1: Sign in to get an access token (valid 15 days)
const authRes = await fetch(`${PEAKAI_BASE}/token`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email: 'your@email.com', password: 'yourpassword' }),
});
const { access_token: token } = await authRes.json();
// Step 2: Look up work email
const params = new URLSearchParams({
type: 'work_email',
profile_url: 'https://linkedin.com/in/johndoe',
});
const res = await fetch(`${PEAKAI_BASE}/api?${params}`, {
method: 'POST',
headers: { Authorization: `Bearer ${token}` },
});
console.log(await res.json());
}
lookupContact();Other Endpoints
Account + uptime utilities
GET /api/balance
Your account's current credit balance and account type. Requires auth.
curl "https://build.thepeakai.com/api/balance" \
-H "Authorization: Bearer <token>"
# Response
{ "credits": 26115, "account_type": "user" }GET /health
Uptime probe. No auth required. Returns 200 when healthy or 503 when the database is unreachable.
curl https://build.thepeakai.com/health
# 200 OK
{ "status": "ok", "db": "ok" }
# 503 Service Unavailable
{ "status": "degraded", "db": "down" }Errors & Rate Limits
Every error returns JSON. Successful Not Found responses are free β credits are only charged on success.
| Status | Meaning |
|---|---|
| 400 | Missing or invalid parameter |
| 401 | Missing, malformed, or expired token |
| 402 | Not enough credits |
| 403 | API access not enabled, or phone not verified |
| 429 | Rate limit exceeded β 60 requests/minute per account |
| 500 | Internal error |
| 501 | Unknown lookup type |
Error body
Always JSON, with a single error field.
{ "error": "Not enough credits. Please recharge." }Not Found
Returned as a normal 200 β no credits charged. The shape is per-type.
{ "linkedin_url": "...", "phone_no": "Not Found" }Caching & debugging
- β’ Successful lookups are cached β a repeat request for the same
profile_urlreturns instantly with"from_cache": true. - β’ Every request is assigned a
reqIdin our logs. Quote it in support emails for fast triage. - β’ Set client timeouts to at least 90 seconds β a cold provider waterfall can take 30β60s; SignalHire async is the slowest.
Best Practices
Tips for optimal API usage
Use the Bearer header
Send the JWT as Authorization: Bearer <token> β not in the query string β so it doesn't leak into server access logs.
Set generous timeouts
At least 90 seconds. A cold provider waterfall can take 30β60s; SignalHire async is the slowest.
Refresh tokens proactively
Access tokens last 15 days. Refresh once they pass ~14 days by calling /token again (limited to 10 req/min per IP).
Cache on your side too
Our cache already deduplicates, but skipping the request entirely is faster. Cache by LinkedIn URL.
Ready to Get Started?
Contact us to enable API access on your account or discuss enterprise solutions.
Email: pg@thepeakai.com β’ Phone: +91 9008227180