Skip to main content

Quickstart

This guide walks you through making your first API call — from obtaining an API key to fetching contacts from a connected CRM.

Prerequisites

You’ll need an API key (sk_live_* or sk_test_*) from the RouteMCP dashboard. If you don’t have one yet, sign up at the dashboard and generate a key from the API Keys page.

1. Connect a Provider

Your end users need to authorize their CRM account before you can access their data. Create a connect token from your backend and use it to launch the Connect widget in their browser.
curl -X POST http://localhost:5001/api/v1/connect/token \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "endUserId": "user-123",
    "endUserDisplayName": "Jane Doe",
    "endUserEmail": "jane@example.com"
  }'
ParameterRequiredDescription
endUserIdYesYour system’s unique ID for this end user
endUserDisplayNameNoDisplay name for the end user
endUserEmailNoEmail address of the end user
Response:
{
  "success": true,
  "data": {
    "token": "ct_abc123...",
    "expiresAt": "2026-03-09T15:00:00.000Z"
  }
}
Use the token to launch the Connect widget in your frontend:
<script src="https://connect.routemcp.com/sdk.js"></script>
<script>
  RouteMCP.connect({
    token: "ct_abc123...",
    onSuccess: (connection) => {
      console.log("Connected!", connection.provider);
    }
  });
</script>
The widget guides your end user through authorizing their CRM (e.g., HubSpot, Zoho). See the Connect Widget guide for full integration details.

2. Fetch Contacts

Once a provider is connected, fetch contacts through the unified API. The endUserId query parameter is required on all resource endpoints — it identifies which end user’s connections to query:
curl "http://localhost:5001/api/v1/contact?endUserId=user-123" \
  -H "Authorization: Bearer sk_live_your_api_key"
This fans out to all connected providers for that end user. To query a specific provider, add the provider parameter:
curl "http://localhost:5001/api/v1/contact?endUserId=user-123&provider=hubspot" \
  -H "Authorization: Bearer sk_live_your_api_key"
Response:
{
  "success": true,
  "statusCode": 200,
  "message": "OK",
  "data": {
    "data": [
      {
        "id": "contact-001",
        "firstName": "Jane",
        "lastName": "Doe",
        "email": "jane@example.com",
        "phone": "+1-555-0100",
        "company": "Acme Corp"
      }
    ],
    "pagination": {
      "cursor": "eyJpZCI6...",
      "hasMore": true,
      "limit": 25
    }
  }
}
The response format is always the same unified schema, regardless of which provider the data comes from.

3. Create a Contact

To write data, specify which provider to create the record in:
curl -X POST "http://localhost:5001/api/v1/contact?provider=hubspot&endUserId=user-123" \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "John",
    "lastName": "Smith",
    "email": "john@example.com",
    "phone": "+1-555-0200"
  }'

4. Work with Other Resources

The same pattern applies to all supported resource types. All endpoints require the endUserId query parameter, and write operations require provider:
# List deals across all providers
curl "http://localhost:5001/api/v1/deal?endUserId=user-123" \
  -H "Authorization: Bearer sk_live_your_api_key"

# Get a specific lead from Zoho
curl "http://localhost:5001/api/v1/lead/lead-001?endUserId=user-123&provider=zoho-crm" \
  -H "Authorization: Bearer sk_live_your_api_key"

# Update a meeting in Pipedrive
curl -X PATCH "http://localhost:5001/api/v1/meeting/mtg-001?endUserId=user-123&provider=pipedrive" \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{ "title": "Updated Meeting Title" }'

# Delete a contact from HubSpot
curl -X DELETE "http://localhost:5001/api/v1/contact/contact-001?endUserId=user-123&provider=hubspot" \
  -H "Authorization: Bearer sk_live_your_api_key"
Writable resources: contact, lead, deal, meeting Read-only resources: owner — list and get only, cannot be created or modified.

Next Steps