Tenant API Docs

Build customer integrations against the public tenant API for leads, users, callbacks, and reporting.

Base URL https://api.{tenantSlug}.leadmanager.cloud/api/v1

Overview

The Lead Manager tenant API is the customer-facing integration surface for a single tenant. Use the tenant API hostname provisioned for that customer, not internal platform or admin routes.

Tenant host format

https://api.{tenantSlug}.leadmanager.cloud/api/v1. Replace {tenantSlug} with the tenant slug from the tenant admin panel.

FormatJSON request and response bodies.
DatesUse ISO 8601 timestamps, for example 2026-06-28T14:30:00Z.
PaginationList endpoints default to page 1 and limit 50. Maximum page size is 100.
IsolationCredentials and access tokens are tenant-scoped. A token from one tenant cannot access another tenant.

Authentication

Tenant admins create API credentials in the tenant admin panel under Settings, Customer API Credentials. The generated client_secret is displayed once, remains valid until its expiration date or revoke event, and is used only to request short-lived access tokens.

1. Exchange API credentials for an access token

Call the token endpoint with the client credentials grant. Access tokens expire after 1500 seconds.

curl -X POST https://api.acme.leadmanager.cloud/api/v1/oauth/token \
  -H "Content-Type: application/json" \
  -d '{
    "grant_type": "client_credentials",
    "client_id": "2c8f65c2-8791-42e7-b08a-2d75f83ce6bd",
    "client_secret": "lmapi_your_client_secret",
    "scope": "leads:read leads:write"
  }'
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 1500,
  "scope": "leads:read leads:write",
  "client_id": "2c8f65c2-8791-42e7-b08a-2d75f83ce6bd",
  "issued_at": "2026-06-28T14:00:00.000Z",
  "expires_at": "2026-06-28T14:25:00.000Z"
}

2. Send the access token on API calls

Authorization: Bearer <access_token>

Do not send the long-lived client_secret to data endpoints. If the credential is revoked, existing resource requests are denied even before the access token expires.

Optional basic authentication for the token endpoint

The token endpoint also accepts HTTP Basic authentication where the username is client_id and the password is client_secret.

curl -X POST https://api.acme.leadmanager.cloud/api/v1/oauth/token \
  -u "2c8f65c2-8791-42e7-b08a-2d75f83ce6bd:lmapi_your_client_secret" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials&scope=leads:read"

Requests

Use Content-Type: application/json for requests with bodies. Empty optional values may be omitted.

Header Required Value
AuthorizationData endpointsBearer <access_token>
Content-TypePOST endpointsapplication/json

Pagination

List endpoints accept page and limit. If no filter is supplied, the API returns the first page of matching records.

{
  "page": {
    "page": 1,
    "limit": 50,
    "totalCount": 250,
    "totalPages": 5,
    "returned": 50,
    "start": 1,
    "end": 50,
    "hasMore": true
  }
}

Scopes

Scopes are assigned to API credentials by a tenant admin. A token request can ask for a subset of those scopes, but cannot request more access than the credential allows.

leads:read leads:write leads:bulk_write users:read users:write callbacks:read callbacks:write reports:read

Endpoints

Method Path Scope Purpose
POST/oauth/tokenclient_credentialsExchange API credentials for an access token.
GET/leadsleads:readList leads with filters and pagination.
GET/leads/{leadId}leads:readGet one lead with activity, callbacks, phone records, and DNC status.
POST/leadsleads:writeAdd one lead.
POST/leads/bulkleads:bulk_writeAdd up to 500 leads in one request.
GET/usersusers:readList tenant users.
POST/usersusers:writeCreate a tenant user and send the welcome email/reset link when email is configured.
GET/callbackscallbacks:readList scheduled callbacks.
GET/callbacks/{callbackId}callbacks:readGet one callback.
POST/callbackscallbacks:writeCreate a callback for a lead.
GET/reportsreports:readGet summary, source, lead set, disposition, activity, callback, fronter, and closer performance data.
GET/reports/leadsreports:readGet report lead rows with pagination.
GET/docsAny active access tokenReturn machine-readable API metadata.

POST /oauth/token

Returns a short-lived access token for data endpoints.

grant_typeRequired. Must be client_credentials.
client_idRequired unless sent through Basic auth.
client_secretRequired unless sent through Basic auth.
scopeOptional space-delimited scope subset.

POST /leads

Creates a lead. Include source to identify where the lead originated.

curl -X POST https://api.acme.leadmanager.cloud/api/v1/leads \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "John",
    "lastName": "Smith",
    "phone": "+1555019283",
    "altPhone": "+1555019284",
    "email": "john.smith@example.com",
    "source": "website_form",
    "leadTier": "A",
    "notes": "Requested a callback"
  }'
{
  "success": true,
  "lead": {
    "leadId": "lead_7d3c2f",
    "name": "John Smith",
    "phone": "+1555019283",
    "email": "john.smith@example.com",
    "source": "website_form",
    "submittedAt": "2026-06-28T14:08:31.000Z"
  }
}

GET /leads

Returns leads for the tenant. Accepted filters include q, tier, disposition, assignee, stat, sort, and direction.

curl "https://api.acme.leadmanager.cloud/api/v1/leads?page=1&limit=50&source=website_form" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

POST /leads/bulk

Adds up to 500 leads per request. Use sourceFile to label the source batch.

curl -X POST https://api.acme.leadmanager.cloud/api/v1/leads/bulk \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "sourceFile": "partner-upload-2026-06-28.csv",
    "defaultLeadTier": "B",
    "applyLeadTier": true,
    "leads": [
      {
        "name": "Mary Johnson",
        "phone": "+1555019200",
        "email": "mary@example.com",
        "source": "partner_feed"
      },
      {
        "firstName": "Alex",
        "lastName": "Rivera",
        "phone": "+1555019201",
        "source": "partner_feed"
      }
    ]
  }'

GET /users

Lists tenant users. Accepted filters include page, limit, q, role, and isAdmin.

curl "https://api.acme.leadmanager.cloud/api/v1/users?page=1&limit=50&role=fronter" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

POST /users

Creates a tenant user. Use tempPassword with changePasswordOnNextLogin when an integration sets the initial password.

curl -X POST https://api.acme.leadmanager.cloud/api/v1/users \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "displayName": "Taylor Brooks",
    "username": "taylor.brooks",
    "email": "taylor@example.com",
    "role": "fronter",
    "isAdmin": false,
    "tempPassword": "TempPass-ChangeMe-2026",
    "changePasswordOnNextLogin": true
  }'

POST /callbacks

Creates a scheduled callback attached to a lead.

curl -X POST https://api.acme.leadmanager.cloud/api/v1/callbacks \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "leadId": "lead_7d3c2f",
    "scheduledAt": "2026-06-29T16:30:00Z",
    "assignedToEmail": "taylor@example.com",
    "note": "Customer requested an afternoon callback"
  }'

GET /callbacks

Lists callbacks. Accepted filters include from, until, status, assignedTo, leadId, and q.

curl "https://api.acme.leadmanager.cloud/api/v1/callbacks?from=2026-06-28&until=2026-06-30&status=open" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

GET /reports

Returns report summary data for the selected filters, including fronterPerformance and closerPerformance arrays. Accepted filters include dateStart, dateEnd, dateField, q, disposition, outcome, source, sourceFile, assignee, state, and limit.

curl "https://api.acme.leadmanager.cloud/api/v1/reports?dateStart=2026-06-01&dateEnd=2026-06-30&source=website_form" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

GET /reports/leads

Returns report lead rows with pagination and the same report filters.

curl "https://api.acme.leadmanager.cloud/api/v1/reports/leads?page=1&limit=100&dateStart=2026-06-01&dateEnd=2026-06-30" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Errors

Error responses use a consistent JSON shape. Save the requestId when contacting support.

{
  "error": "API access token expired",
  "code": "API_ACCESS_TOKEN_EXPIRED",
  "requestId": "7b3f17f6-8068-4b50-bdb1-d7466123bb90"
}
Status Common code Meaning
400INVALID_JSONThe request body is not valid JSON.
400UNSUPPORTED_GRANT_TYPEThe token request did not use client_credentials.
401INVALID_CLIENT_CREDENTIALSThe client_id or client_secret is wrong.
401API_ACCESS_TOKEN_EXPIREDRequest a new access token and retry the API call.
403API_SCOPE_DENIEDThe access token does not include the required scope.
404NOT_FOUNDThe route or requested record was not found.