> ## 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.

# Quickstart

> Get up and running with the RouteMCP API in under 10 minutes

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

## 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 or accounting 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.

```bash theme={null}
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"
  }'
```

| Parameter            | Required | Description                               |
| -------------------- | -------- | ----------------------------------------- |
| `endUserId`          | Yes      | Your system's unique ID for this end user |
| `endUserDisplayName` | No       | Display name for the end user             |
| `endUserEmail`       | No       | Email address of the end user             |

Response:

```json theme={null}
{
  "success": true,
  "data": {
    "token": "ct_abc123...",
    "expiresAt": "2026-03-09T15:00:00.000Z"
  }
}
```

Use the token to launch the Connect widget in your frontend:

```html theme={null}
<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) or accounting system (e.g., QuickBooks Online). See the [Connect Widget](/guides/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:

```bash theme={null}
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:

```bash theme={null}
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:

```json theme={null}
{
  "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:

```bash theme={null}
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:

```bash theme={null}
# 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

* [Authentication](/guides/authentication) — API key types, environments, and best practices
* [Connect Widget](/guides/connect-widget) — Embed the provider authorization flow
* [Field Mappings](/guides/field-mappings) — Understand how provider data maps to the unified schema
* [Error Codes](/references/errors) — Handle errors gracefully
* [API Reference](/api-reference/overview) — Full endpoint reference
