Every API here is available over the APIs.io API and to AI agents over MCP.
{
"openapi": "3.1.0",
"info": {
"title": "Luca API",
"version": "1.0.0",
"description": "The Luca API is the same surface the coach dashboard runs on. Every endpoint is\nscoped to one coach, and every response is JSON.\n\n## Authentication\n\nTwo credentials work. A Better Auth session cookie (`luca.session_token`) is\nwhat the dashboard uses. An organization API key is what everything else uses.\nsend it as `x-api-key`, or as `Authorization: Bearer <key>`.\n\nThe two are not interchangeable. An API key only reaches the endpoints on the\npublished allowlist, and only with the scopes granted to that key. Endpoints\ndocumented as session-only exist for the dashboard and return 403 to a key, no\nmatter its scopes. Each operation below lists which credentials it accepts.\n\nMint and revoke keys under **API keys**. `GET /api/capabilities` returns the\nlive list of what the calling credential can reach, which is cheaper than\nprobing.\n\n## Workspaces\n\nA user in more than one workspace picks one per request with\n`x-luca-workspace-id` or `x-luca-workspace-slug`. Omit both and the request\nresolves to the caller's default workspace.\n\n## Errors\n\nEvery failure returns the same envelope, on every status:\n\n```json\n{\n \"error\": {\n \"code\": \"lead_not_found\",\n \"message\": \"lead not found\",\n \"requestId\": \"01JD…\",\n \"details\": null\n }\n}\n```\n\nBranch on `error.code`, never on `error.message`. The message is written for\na human and can change. Quote `requestId` in a support ticket and we can find\nthe exact request.\n\nThe statuses worth handling specifically:\n\n| Status | What it means |\n| --- | --- |\n| 401 | No usable credential. |\n| 402 | The workspace is unpaid, past due, or cannot fund the requested work. |\n| 403 | The plan tier or the key's scopes do not include this endpoint. |\n| 409 | An idempotency key was reused with a different request body. |\n| 429 | Rate limited. 120 requests per coach per minute, sliding window. |\n\n## Idempotency\n\nMutations that create or launch something accept an `Idempotency-Key` header,\nand some require it. A replayed key returns the original response with\n`Idempotency-Replayed: true` instead of acting twice. Keys are held for 24\nhours.\n\n## Rate limits\n\n120 requests per coach per minute, per endpoint, on a sliding window.\n\nEvery response under `/api` carries the quota policy. Every response that\nreached the counter also carries the live state:\n\n| Header | Meaning |\n| --- | --- |\n| `RateLimit-Policy` | The quota in effect, as `\"default\";q=120;w=60`. |\n| `RateLimit` | What is left, as `\"default\";r=<remaining>;t=<seconds to reset>`. |\n| `RateLimit-Limit` | The same quota as a bare integer. |\n| `RateLimit-Remaining` | Requests left in the current window. |\n| `RateLimit-Reset` | Seconds until the current window rolls over. |\n| `Retry-After` | On a 429 only. Seconds to wait before retrying. |\n\n`RateLimit-Policy` and `RateLimit` follow the IETF RateLimit header fields\ndraft. The `-Limit`/`-Remaining`/`-Reset` triple ships alongside them because\nmost SDKs still read that spelling. A request refused before it is attributed\nto a coach, such as an unauthenticated 401, carries the policy without the live\nstate: there is no counter to report yet.\n\n`RateLimit-Reset` and `Retry-After` count the seconds left in the current\nwindow rather than a whole window, so a client that waits does not wait longer\nthan the limiter would have held it.\n\n## Webhooks\n\nSubscribe to events under **Webhooks** instead of polling.\n`GET /api/webhook-subscriptions/signature-guide` returns the signing scheme\nand a verification example.\n\n## Versioning\n\nThis is version 1 of the API. Every response carries `Luca-API-Version: 1`, and\n`info.version` in this document is the spec revision within that major version.\n\nInside a major version we only make additive changes: new endpoints, new\noptional request fields, new properties on an existing response. Treat unknown\nresponse properties as forgiving — do not fail a parse because a field you have\nnot seen appeared. Anything that would break a correct client (removing a field,\nnarrowing a type, changing a status code, tightening validation) ships as a new\nmajor version on a new path prefix, and version 1 keeps serving.\n\nSend `Luca-API-Version: 1` on a request to assert the major version you built\nagainst. Naming any other major version is refused with 400\n`unsupported_api_version`, rather than served by a version that does not match\nwhat the client expects. Omit the header and the request is served by version 1.\n\n## Deprecation\n\nA retiring endpoint is announced on the endpoint itself, so a running\nintegration finds out without anyone reading a changelog. Two response headers\ncarry it:\n\n| Header | Meaning |\n| --- | --- |\n| `Deprecation` | An HTTP date. The endpoint is deprecated as of this date and still works. |\n| `Sunset` | An HTTP date. After this the endpoint stops answering. |\n\n`Deprecation` follows RFC 9745, `Sunset` follows RFC 8594. A deprecated\noperation is also marked `deprecated: true` in this document, so a generated\nclient can surface it at build time. Watch for both headers and alert on them."
},
"externalDocs": {
"description": "Luca developer documentation",
"url": "https://setluca.com/developers"
},
"tags": [
{
"name": "Capabilities",
"description": "What the calling credential can actually reach. Read this first. It answers the scope and plan-tier question for the current key without probing every endpoint for a 403."
},
{
"name": "Debug",
"description": "Inspect how a recent inbound message moved through the pipeline. Diagnostic only, and session-only."
},
{
"name": "Leads",
"description": "People who messaged the coach. A lead carries the score, stage, consents, notes, and custom fields, and is the anchor every conversation, booking, and campaign enrollment hangs off. Bulk import lives here too. Preview first, then apply."
},
{
"name": "Conversations",
"description": "Message threads with a lead, across every connected channel. Sending here writes to the real channel, so an auto-send-disabled workspace should queue a draft through the review queue instead."
},
{
"name": "Review queue",
"description": "Drafts waiting for the coach: approve, reject, or restore them. Luca-drafted DM replies auto-send by default, so a reply lands here when its channel is in review mode, the message is urgent, the account's health blocks sending, or the coach drafted it on demand. `explain` returns why Luca wrote what it wrote."
},
{
"name": "Memory",
"description": "Durable facts Luca carries between conversations about a coach or a lead. Editing memory changes future drafts."
},
{
"name": "Bookings",
"description": "Scheduled calls and their outcomes. Covers the booking record, the pre-call brief, guest links, and the outcome each call is closed with."
},
{
"name": "Booking types",
"description": "The call types a coach offers: duration, attendees, and the schedule each one is bookable on."
},
{
"name": "Booking providers",
"description": "Connections to Calendly, Cal.com, iClosed, GoHighLevel, or a manual link, plus the calendars and availability they expose."
},
{
"name": "Call events",
"description": "What happened on a call: recording-derived summaries, feedback, CRM push, and outcome corrections."
},
{
"name": "Campaigns",
"description": "Multi-step outreach a lead is enrolled into. Draft, simulate against real provider capabilities, publish, then read per-enrollment timelines."
},
{
"name": "Broadcasts",
"description": "One message to a segment. Preview and approve before launch. You can pause a launched broadcast, but sent messages don't come back."
},
{
"name": "Cadences",
"description": "Silent-lead rescue. Starts the follow-up sequence for leads who went quiet."
},
{
"name": "A/B tests",
"description": "Split tests over drafted replies and objection handling. A winner can be adopted into the live playbook."
},
{
"name": "Voice",
"description": "The voice fingerprint: the corpus of the coach's own writing that every draft is matched against. This is a visible product surface, not backend plumbing: changing it visibly changes how Luca sounds."
},
{
"name": "Knowledge",
"description": "Source material Luca can cite: offers, program details, and FAQs. Suggestions are Luca proposing new knowledge it inferred; they take effect only once approved."
},
{
"name": "Objections",
"description": "The objection playbook: recurring objections and the responses that work on them."
},
{
"name": "Learning",
"description": "What Luca has learned from outcomes: proposed prompt changes awaiting review, and how each sales framework is performing."
},
{
"name": "Copilot",
"description": "Ask Luca, the in-app chat agent. Chats, streaming tokens, and the confirm/discard step for actions it proposes taking."
},
{
"name": "Analytics",
"description": "The measurement surface: funnel, revenue, forecast, speed-to-lead, objections, call intelligence, content attribution, and cross-workspace benchmarks. Benchmarks require explicit consent."
},
{
"name": "Insights",
"description": "The proactive feed. Luca surfaces something worth acting on, and the coach reads, acts on, or dismisses it."
},
{
"name": "Reports",
"description": "Prepared rollups: the morning report and the scorecard."
},
{
"name": "Audit log",
"description": "Who changed what, and when. Every mutation that touches coach-visible state writes a row here."
},
{
"name": "Channels",
"description": "Telegram, Instagram, Messenger, and WhatsApp connections."
},
{
"name": "Integrations",
"description": "The connector catalog and the integration event stream."
},
{
"name": "CRM",
"description": "CRM connections: OAuth, field mappings, schema discovery, sync runs, and connection health."
},
{
"name": "OAuth connections",
"description": "Third-party authorizations granted to this workspace, and revoking them."
},
{
"name": "Webhooks",
"description": "Outbound event delivery. Subscribe, inspect deliveries, replay a failed one, and verify signatures with the signing guide."
},
{
"name": "Coach profile",
"description": "The coach record and how they sell: niche, sales framework, objection playbook, and post-call CRM behavior."
},
{
"name": "Onboarding",
"description": "First-time setup: profile, channel connection, voice corpus seeding, and preferences."
},
{
"name": "Workspaces",
"description": "List the workspaces the signed-in user belongs to, and create or recover their personal workspace."
},
{
"name": "First run",
"description": "The trial coach's first-session state and the value Luca has produced so far."
},
{
"name": "Settings",
"description": "Workspace behavior toggles: auto-send, multi-part drafts, the tool belt, and voice settings."
},
{
"name": "Team members",
"description": "Invite people to a workspace, change their role and extra permissions, remove them, and accept or decline an invitation."
},
{
"name": "Privacy",
"description": "The signed-in user's own choices: terms acceptance and the account advertising choice. API keys cannot call these routes."
},
{
"name": "API keys",
"description": "Create, scope, and revoke the organization API keys this API accepts. A key is shown once, at creation."
},
{
"name": "Mobile",
"description": "Push device registration and notification preferences. Notifications carry routing metadata only, never message or draft text."
},
{
"name": "Account safety",
"description": "The health of a workspace's channel connections against platform rate limits and behavioral limits."
},
{
"name": "Billing",
"description": "Subscription state, Stripe Checkout, the customer portal, and message top-up packs."
},
{
"name": "Usage",
"description": "Month-to-date operational usage. Customer allowances and remaining capacity are available from the billing usage projection."
},
{
"name": "Cancellation",
"description": "The cancel flow: context, retention offer, survey, confirmation, and reactivation."
}
],
"x-tagGroups": [
{
"name": "Platform",
"tags": [
"Capabilities",
"Debug"
]
},
{
"name": "Leads & conversations",
"tags": [
"Leads",
"Conversations",
"Review queue",
"Memory"
]
},
{
"name": "Booking & calls",
"tags": [
"Bookings",
"Booking types",
"Booking providers",
"Call events"
]
},
{
"name": "Outreach",
"tags": [
"Campaigns",
"Broadcasts",
"Cadences",
"A/B tests"
]
},
{
"name": "Voice & training",
"tags": [
"Voice",
"Knowledge",
"Objections",
"Learning"
]
},
{
"name": "Ask Luca",
"tags": [
"Copilot"
]
},
{
"name": "Insights & reporting",
"tags": [
"Analytics",
"Insights",
"Reports",
"Audit log"
]
},
{
"name": "Channels & integrations",
"tags": [
"Channels",
"Integrations",
"CRM",
"OAuth connections",
"Webhooks"
]
},
{
"name": "Account & setup",
"tags": [
"Coach profile",
"Workspaces",
"Onboarding",
"First run",
"Settings",
"Team members",
"Privacy",
"API keys",
"Mobile",
"Account safety"
]
},
{
"name": "Billing",
"tags": [
"Billing",
"Usage",
"Cancellation"
]
}
],
"components": {
"schemas": {
"PendingEmailResponse": {
"type": "object",
"properties": {
"email": {
"type": "string"
}
},
"required": [
"email"
]
},
"PendingEmailRequest": {
"type": "object",
"properties": {
"email": {
"type": "string",
"maxLength": 254,
"format": "email"
}
},
"required": [
"email"
],
"additionalProperties": false
},
"ConnectLinkResponse": {
"type": "object",
"properties": {
"state": {
"type": "string",
"enum": [
"active",
"used",
"revoked",
"expired",
"invalid"
]
},
"workspaceName": {
"type": [
"string",
"null"
]
},
"channel": {
"type": [
"string",
"null"
],
"enum": [
"instagram",
"messenger",
null
]
},
"expiresAt": {
"type": [
"string",
"null"
],
"format": "date-time"
}
},
"required": [
"state",
"workspaceName",
"channel",
"expiresAt"
]
},
"ConnectLinkStartResponse": {
"type": "object",
"properties": {
"authorizationUrl": {
"type": "string"
}
},
"required": [
"authorizationUrl"
]
},
"ConnectLinkPagesResponse": {
"type": "object",
"properties": {
"workspaceName": {
"type": [
"string",
"null"
]
},
"channel": {
"type": "string",
"enum": [
"instagram",
"messenger"
]
},
"pages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"id",
"name"
]
}
}
},
"required": [
"workspaceName",
"channel",
"pages"
]
},
"ConnectLinkPickResponse": {
"type": "object",
"properties": {
"result": {
"type": "string",
"enum": [
"connected"
]
}
},
"required": [
"result"
]
},
"ConnectLinkPickRequest": {
"type": "object",
"properties": {
"pageId": {
"type": "string",
"minLength": 1,
"maxLength": 256
}
},
"required": [
"pageId"
],
"additionalProperties": false
},
"ConversationSearchResponse": {
"type": "object",
"properties": {
"hits": {
"type": "array",
"items": {
"type": "object",
"properties": {
"messageId": {
"type": "string"
},
"leadId": {
"type": "string"
},
"leadName": {
"type": [
"string",
"null"
]
},
"channel": {
"type": "string"
},
"direction": {
"type": "string"
},
"body": {
"type": "string"
},
"at": {
"type": [
"string",
"null"
]
}
},
"required": [
"messageId",
"leadId",
"leadName",
"channel",
"direction",
"body",
"at"
]
}
}
},
"required": [
"hits"
]
},
"CopilotRecallResponse": {
"type": "object",
"properties": {
"hits": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"content": {
"type": "string"
},
"source": {
"type": "string"
},
"trustLevel": {
"type": "string",
"enum": [
"manual",
"trusted_pipeline"
]
}
},
"required": [
"id",
"content",
"source",
"trustLevel"
]
}
}
},
"required": [
"hits"
]
},
"LeadBestSendTimeResponse": {
"type": "object",
"properties": {
"suggestedHourUtc": {
"type": [
"integer",
"null"
],
"minimum": 0,
"maximum": 23
},
"sampleSize": {
"type": "integer"
},
"confidence": {
"type": "string",
"enum": [
"none",
"low",
"medium"
]
},
"histogram": {
"type": "array",
"items": {
"type": "object",
"properties": {
"hourUtc": {
"type": "integer"
},
"count": {
"type": "integer"
}
},
"required": [
"hourUtc",
"count"
]
}
},
"note": {
"type": [
"string",
"null"
]
}
},
"required": [
"suggestedHourUtc",
"sampleSize",
"confidence",
"histogram",
"note"
]
},
"LeadsCountResponse": {
"type": "object",
"properties": {
"count": {
"type": "integer"
}
},
"required": [
"count"
]
},
"TopLeadsResponse": {
"type": "object",
"properties": {
"leads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"channel": {
"type": "string"
},
"displayName": {
"type": [
"string",
"null"
]
},
"stage": {
"type": "string"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"score": {
"type": [
"number",
"null"
]
},
"createdAt": {
"type": "string"
},
"lastSeenAt": {
"type": [
"string",
"null"
]
}
},
"required": [
"id",
"channel",
"displayName",
"stage",
"tags",
"score",
"createdAt",
"lastSeenAt"
]
}
}
},
"required": [
"leads"
]
},
"FunnelInsightsResponse": {
"type": "object",
"properties": {
"outcomesByChannel": {
"type": "array",
"items": {
"type": "object",
"properties": {
"channel": {
"type": "string"
},
"won": {
"type": "number"
},
"lost": {
"type": "number"
},
"notAFit": {
"type": "number"
}
},
"required": [
"channel",
"won",
"lost",
"notAFit"
]
}
},
"objectionBuckets": {
"type": "array",
"items": {
"type": "object",
"properties": {
"bucket": {
"type": "string"
},
"count": {
"type": "number"
}
},
"required": [
"bucket",
"count"
]
}
}
},
"required": [
"outcomesByChannel",
"objectionBuckets"
]
},
"VoiceSignalsResponse": {
"type": "object",
"properties": {
"signalCounts": {
"type": "object",
"properties": {
"approved": {
"type": "integer"
},
"edited": {
"type": "integer"
},
"rejected": {
"type": "integer"
}
},
"required": [
"approved",
"edited",
"rejected"
]
},
"avgEditDistance": {
"type": [
"number",
"null"
]
},
"recentVoiceCorpus": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"source": {
"type": "string"
},
"content": {
"type": "string"
},
"createdAt": {
"type": "string"
}
},
"required": [
"id",
"source",
"content",
"createdAt"
]
}
}
},
"required": [
"signalCounts",
"avgEditDistance",
"recentVoiceCorpus"
]
},
"VoiceEditDistanceResponse": {
"type": "object",
"properties": {
"sampleSize": {
"type": "integer"
},
"avgDistance": {
"type": [
"number",
"null"
]
},
"medianDistance": {
"type": [
"number",
"null"
]
},
"p90Distance": {
"type": [
"number",
"null"
]
},
"windowDays": {
"type": "integer"
}
},
"required": [
"sampleSize",
"avgDistance",
"medianDistance",
"p90Distance",
"windowDays"
]
},
"VoiceHeavyEditsResponse": {
"type": "object",
"properties": {
"heavyEdits": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"reviewQueueId": {
"type": [
"string",
"null"
]
},
"editDistance": {
"type": [
"number",
"null"
]
},
"draftBody": {
"type": "string"
},
"createdAt": {
"type": "string"
}
},
"required": [
"id",
"reviewQueueId",
"editDistance",
"draftBody",
"createdAt"
]
}
}
},
"required": [
"heavyEdits"
]
},
"BookingCapabilitiesResponse": {
"type": "object",
"properties": {
"capabilities": {
"type": "array",
"items": {
"type": "object",
"properties": {
"provider": {
"type": "string"
},
"operations": {
"type": "array",
"items": {
"type": "object",
"properties": {
"operation": {
"type": "string"
},
"support": {
"type": "string",
"enum": [
"direct",
"handoff",
"unsupported"
]
}
},
"required": [
"operation",
"support"
]
}
},
"editableFields": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"provider",
"operations",
"editableFields"
]
}
}
},
"required": [
"capabilities"
]
},
"ReplyRewriteResponse": {
"type": "object",
"properties": {
"reviewItemId": {
"type": "string"
},
"leadId": {
"type": "string"
},
"originalBody": {
"type": "string"
},
"proposedBody": {
"type": "string"
},
"voiceMatch": {
"type": "number"
},
"criticFlags": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"reviewItemId",
"leadId",
"originalBody",
"proposedBody",
"voiceMatch",
"criticFlags"
]
},
"ReplyRewriteRequest": {
"type": "object",
"properties": {
"reviewItemId": {
"type": "string",
"format": "uuid"
},
"instruction": {
"type": "string",
"minLength": 1,
"maxLength": 500
}
},
"required": [
"reviewItemId",
"instruction"
]
},
"AbTestListResponse": {
"type": "object",
"properties": {
"tests": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"coachId": {
"type": "string",
"format": "uuid"
},
"name": {
"type": "string"
},
"description": {
"type": [
"string",
"null"
]
},
"status": {
"type": "string",
"enum": [
"draft",
"running",
"paused",
"completed",
"archived"
]
},
"testType": {
"type": "string",
"enum": [
"message_copy",
"objection_strategy",
"tone",
"opening",
"cta_type",
"offer_presentation",
"voice_vs_text",
"sales_framework",
"multi_stage"
]
},
"variantA": {
"type": "object",
"properties": {
"frameworkId": {
"type": "string"
},
"objectionType": {
"type": "string"
},
"strategy": {
"type": "string"
}
},
"additionalProperties": {}
},
"variantB": {
"type": "object",
"properties": {
"frameworkId": {
"type": "string"
},
"objectionType": {
"type": "string"
},
"strategy": {
"type": "string"
}
},
"additionalProperties": {}
},
"trafficSplit": {
"type": "integer"
},
"successMetric": {
"type": "string",
"enum": [
# --- truncated at 32 KB (2565 KB total) ---
# Full source: https://artifacts.apis.io/setluca-com/openapi/_original/setluca-com-openapi-openapi.json