API v1.0.0

API Reference

Welcome to the Routeswit API. Our API is built on REST principles, providing a structured way to integrate lead routing, sales representative management, and activity tracking into your existing workflows.

Base URL
https://routeswit.vercel.app/api/v1
Format

All requests should use application/json and will return JSON responses.

API Playground

Test your integration in real-time. Use your secret API key to execute live requests against our production environment.

API Playground
Interactive environment to test live API requests against your organization data.
HTTPS RequiredCORS Enabled

Your key is only used for this session and is never stored on our servers.

Run a request to see the response payload

Authentication

The Routeswit API uses API keys for authentication. You can generate and revoke these keys within yourOrganization Settings.

Authorization Header

Include your secret API key in the Authorization header for all requests. Do not share your keys or commit them to version control.

Authorization: Bearer sk_live_your_secret_key

Security Enforcement

All requests must be made via HTTPS. Insecure HTTP requests will be blocked. Additionally, use restricted keys for limited-scope integrations when possible.

Response Codes

We use standard HTTP status codes to communicate the result of your API requests.

StatusCodeDescription
200 OK-The request was successful.
401UNAUTHORIZEDInvalid or missing API key.
404NOT_FOUNDThe requested resource does not exist.
422VALIDATION_ERRORThe request body was invalid or contained errors.
500SERVER_ERRORInternal server error. Our team has been notified.

Leads

The Leads resource is the core of Routeswit. Use this endpoint to ingest incoming leads and distribute them to the appropriate representative based on your defined rules.

POST/leads
Route a Lead
Evaluates attributes against a ruleset to find the best match.

Parameters

lead_idRequired

string

The unique identifier for the lead in your external system (CRM, Website, etc).
ruleset_idRequired

string

The slug or ID of the ruleset to execute.
attributesRequired

object

Key-value pairs used for rule matching (e.g., "region": "West").

Request Example

curl -X POST https://routeswit.vercel.app/api/v1/leads \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "lead_id": "LD-8902",
    "ruleset_id": "enterprise-sales",
    "attributes": {
      "company_size": 500,
      "region": "EMEA",
      "source": "Webinar"
    }
  }'

Representatives

Manage your sales team's availability and routing capacity.

GET/reps

List all representatives associated with your organization.

[
  {
    "id": "rep_123",
    "name": "Alex Rivera",
    "email": "alex@company.com",
    "status": "AVAILABLE"
  },
  ...
]
POST/reps
Create Representative
nameFull name of the representative.
emailUsed for notifications and assignment alerts.

Rulesets

Define your business logic. Rulesets consist of conditions and actions that determine which representative receives a lead.

POST/rules
Update Ruleset
Synchronize your routing logic via JSON.
{
  "name": "EMEA Inbound",
  "slug": "emea-inbound",
  "rules": [
    {
      "condition": "attributes.country == 'UK'",
      "target_id": "rep_london_office"
    }
  ]
}

Contacts & Activities

Maintain a persistent history of every lead and their engagement over time.

POST/contacts

Upsert contact details to keep records synchronized.

POST/contacts/[id]/activities

Log a Call or Meeting

{
  "type": "CALL",
  "notes": "Discussed expansion to 50 seats.",
  "outcome": "POSITIVE"
}

Intelligence

Gain insights into your routing performance and set up automated SLA monitors.

GET
/analytics/summary
Retrieve conversion rates, average response times, and routing efficiency metrics.
POST
/slas
Define thresholds for response times and configure webhook notifications for breaches.

Start Building Today

Join hundreds of organizations optimizing their sales flow with Routeswit. Need a custom integration or have questions? Our engineering team is standing by.