Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.routemcp.io/llms.txt

Use this file to discover all available pages before exploring further.

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 https://api.routemcp.io/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 X-End-User-Id header is required on all resource endpoints — it identifies which end user’s connections to query:
curl "https://api.routemcp.io/api/v1/crm/contact" \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "X-End-User-Id: user-123"
This fans out to all connected providers for that end user. To query a specific provider, add the provider parameter:
curl "https://api.routemcp.io/api/v1/crm/contact?provider=hubspot" \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "X-End-User-Id: user-123"
Response:
{
  "success": true,
  "statusCode": 200,
  "message": "OK",
  "data": {
    "data": [
      {
        "id": "contact-001",
        "first_name": "Jane",
        "last_name": "Doe",
        "email_addresses": [{ "email_address": "jane@example.com", "email_address_type": "Work" }],
        "phone_numbers": [{ "phone_number": "+1-555-0100", "phone_number_type": "Mobile" }]
      }
    ],
    "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 "https://api.routemcp.io/api/v1/crm/contact?provider=hubspot" \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -H "X-End-User-Id: user-123" \
  -d '{
    "first_name": "John",
    "last_name": "Smith",
    "email_addresses": [{ "email_address": "john@example.com", "email_address_type": "Work" }],
    "phone_numbers": [{ "phone_number": "+1-555-0200", "phone_number_type": "Mobile" }]
  }'

4. Work with Other Resources

The same pattern applies to all supported resource types. All endpoints require the X-End-User-Id header, and write operations require the provider query parameter:
# List deals across all providers
curl "https://api.routemcp.io/api/v1/crm/deal" \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "X-End-User-Id: user-123"

# Get a specific lead from Zoho
curl "https://api.routemcp.io/api/v1/crm/lead/lead-001?provider=zoho-crm" \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "X-End-User-Id: user-123"

# Update a meeting in Pipedrive
curl -X PATCH "https://api.routemcp.io/api/v1/crm/meeting/mtg-001?provider=pipedrive" \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -H "X-End-User-Id: user-123" \
  -d '{ "title": "Updated Meeting Title" }'

# Delete a contact from HubSpot
curl -X DELETE "https://api.routemcp.io/api/v1/crm/contact/contact-001?provider=hubspot" \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "X-End-User-Id: user-123"
Writable resources: contact, lead, deal, meeting, company, note, task, activity, appointment Read-only resources: owner, pipeline — list and get only, cannot be created or modified.

Next Steps