Getting started
This walks you through your first authenticated request — fetching a page of contacts.
Base URL
Every request goes to https://papi.trendev.in/v1. All endpoint paths below are relative to this base. You can
also run any call live from the API Reference using the Try It panel.
1. Get a token
The API authenticates with an OAuth 2.0 Bearer token scoped to a single tenant (business_id). For
server-to-server use, issue a per-tenant Personal Access Token (PAT); for marketplace apps acting on
behalf of a user, use the authorization-code + PKCE flow. Both are covered in
Authentication.
A token carries the tenant and the acting user's role — you never put business_id in the URL.
2. Make a request
Every request needs two headers:
Authorization: Bearer <token>Version: <YYYY-MM-DD>— the dated behavior contract (see Versioning).
- cURL
- Python
- Node.js
curl -X POST https://papi.trendev.in/v1/contacts/search \
-H "Authorization: Bearer $PROSPECTCONNECT_TOKEN" \
-H "Version: 2026-06-01" \
-H "Content-Type: application/json" \
-d '{ "limit": 2, "order_by": "created_at", "sort_direction": "desc" }'
import os, requests
resp = requests.post(
"https://papi.trendev.in/v1/contacts/search",
headers={
"Authorization": f"Bearer {os.environ['PROSPECTCONNECT_TOKEN']}",
"Version": "2026-06-01",
},
json={"limit": 2, "order_by": "created_at", "sort_direction": "desc"},
timeout=30,
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://papi.trendev.in/v1/contacts/search", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PROSPECTCONNECT_TOKEN}`,
Version: "2026-06-01",
"Content-Type": "application/json",
},
body: JSON.stringify({ limit: 2, order_by: "created_at", sort_direction: "desc" }),
});
if (!resp.ok) throw new Error(`${resp.status} ${await resp.text()}`);
console.log(await resp.json());
3. Read the response
Lists always come back in the same cursor envelope:
{
"data": [
{ "id": "con_8f2a1c9b4d6e7f0a1b2c3d4e", "first_name": "Avery", "last_name": "Diaz", "email": "avery@example.com" },
{ "id": "con_1b2c3d4e5f60718293a4b5c6", "first_name": "Sam", "last_name": "Cole", "email": "sam@example.com" }
],
"meta": {
"cursor": { "next": "eyJvIjoyfQ", "has_more": true },
"total": 13658
}
}
To get the next page, pass meta.cursor.next back as the cursor field. See
Pagination for the full loop.
4. Fetch one record
curl https://papi.trendev.in/v1/contacts/con_8f2a1c9b4d6e7f0a1b2c3d4e \
-H "Authorization: Bearer $PROSPECTCONNECT_TOKEN" \
-H "Version: 2026-06-01"
What's next
- Learn the search filter shape to query precisely.
- Handle failures with the error model (
trace_idis your friend in support tickets). - Make creates safely retryable with an Idempotency-Key.
- Browse the full API Reference and try calls live in the browser.