Skip to main content

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 -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" }'

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