# Available Fields Source: https://docs.lonescale.com/api-reference/crm-sync-fields The records you send to [CRM Sync](/api-reference/endpoint/crm-sync) are free-form JSON objects. Their keys are **LoneScale field keys**, the same vocabulary your CRM integration mapping is built on. Two rules decide what actually reaches your CRM: 1. LoneScale only reads the keys your mapping references. A key you send that no mapped field and no unicity criterion points at is ignored. 2. A record whose keys match **none** of them is failed rather than silently written as a no-op, and the error lists the keys that mapping expects. Call [`GET /crm/mapping`](/api-reference/endpoint/crm-mapping) to see exactly which of the fields below your own mapping uses, before pushing anything. > [!NOTE] > > **The prefix is optional.** Every key below can be sent without its `lonescale_` or `main_` prefix: `first_name`, `job_title`, `company_domain`, `email`, `phone`. Both forms work, and the bare one never overrides a prefixed key you sent explicitly. ## People | Field key | Description | | - | - | | `lonescale_first_name` | First name | | `lonescale_last_name` | Last name | | `lonescale_full_name` | Full name | | `lonescale_linkedin_url` | LinkedIn profile URL | | `lonescale_universal_name` | LinkedIn public identifier (the slug in the profile URL) | | `lonescale_job_title` | Job title | | `lonescale_job_seniority` | Seniority level | | `lonescale_department` | Department | | `lonescale_sub_department` | Sub-department | | `lonescale_level` | Hierarchical level | | `lonescale_summary` | Profile summary | | `lonescale_city` | City | | `lonescale_geo_location_name` | Location name | | `lonescale_geo_country_name` | Country name | | `lonescale_country_code` | Country code | ## Contact details | Field key | Description | | - | - | | `main_email` | Primary email | | `main_email_status` | Deliverability status of the primary email | | `secondary_emails` | Additional emails | | `secondary_emails_status` | Deliverability status of the additional emails | | `main_phone` | Primary phone | | `main_phone_region` | Region code of the primary phone | | `secondary_phones` | Additional phones | | `secondary_phones_region` | Region codes of the additional phones | ## Company Company keys can be embedded on a contact record (to create or update the associated account at the same time) or sent on their own in the `companies` array. | Field key | Description | | - | - | | `lonescale_company_name` | Company name | | `lonescale_company_domain` | Company domain | | `lonescale_company_description` | Company description | | `lonescale_company_industry` | Industry | | `lonescale_company_linkedin_url` | Company LinkedIn URL | | `lonescale_company_linkedin_id` | Company LinkedIn id | | `lonescale_company_staff_count` | Employee count | | `lonescale_company_employee_range` | Employee range | | `lonescale_company_country` | Country | | `lonescale_company_country_code` | Country code | ## CRM ids | Field key | Description | | - | - | | `contact_crm_id` | Update this exact CRM contact by id (for example the id returned by [`POST /crm/search`](/api-reference/endpoint/crm-search)), skipping unicity matching | | `account_crm_id` | Target this exact CRM company by id (for example the id of a `companies[i]` match returned by [`POST /crm/search`](/api-reference/endpoint/crm-search)) instead of matching by unicity criteria | | `owner_id` | Salesforce only: the User id (`005…`) that owns the created or updated Lead or Contact. Without it the CRM keeps its default owner on create and the current owner on update. A mapping row on `OwnerId` takes precedence | | `crm_company_id` | The associated company id, available to your mapping as a value to write | ## Accepted aliases Field keys are resolved before the mapping runs, so several spellings of the same field work. **Without the prefix.** Drop `lonescale_` or `main_` from any key in the tables above and it still resolves: `first_name`, `full_name`, `job_title`, `linkedin_url`, `department`, `city`, `country_code`, `company_name`, `company_domain`, `company_staff_count`, `email`, `email_status`, `phone`, `phone_region`. Person and company keys stay distinct: `city` is the contact's, `company_city` is the account's. **From an enrich payload.** You can also send our enrich output verbatim. | You send | Resolved to | | - | - | | `firstName`, `lastName`, `fullName` | `lonescale_first_name`, `lonescale_last_name`, `lonescale_full_name` | | `linkedinUrl`, `universalName` | `lonescale_linkedin_url`, `lonescale_universal_name` | | `jobTitle` | `lonescale_job_title` | | `email`, `emailStatus` | `main_email`, `main_email_status` | | `phone`, `phoneCountryCode` | `main_phone`, `main_phone_region` | | `lonescale_email`, `lonescale_phone` | `main_email`, `main_phone` | | `companyName`, `companyDomain`, `companyDescription`, `companyIndustry` | the matching `lonescale_company_*` key | | `companyEmployeeCount`, `companyEmployeeRange` | `lonescale_company_staff_count` and `lonescale_company_employee_count`, `lonescale_company_employee_range` | | `companyLinkedinUrl`, `companyLinkedinId`, `companyCity`, `companyCountry`, `companyCountryCode` | the matching `lonescale_company_*` key | | any bare `company_*` key | the matching `lonescale_company_*` key | An alias never overwrites a key you sent explicitly. ## Salesforce: Contacts or Leads For Salesforce, the mapping also decides **which object** is written, exactly like in a workflow. No parameter on the request controls it: * Map the Contact section and the sync writes Contacts. * Map only the Lead section, leaving the Contact one empty, and the sync searches your Lead unicity criteria, then updates the match or creates a Lead. `GET /crm/mapping` reports this as `object: "contact"` or `object: "lead"`, and returns the resolved lead mapping alongside it. > [!NOTE] > > Salesforce requires `Company` on Lead creation, so map it from `lonescale_company_name` and send that key on every record that may create a Lead. ## Example ```json theme={null} { "crm": "salesforce", "settings_type": "api_sync", "contacts": [ { "first_name": "Ada", "last_name": "Lovelace", "job_title": "Head of Data", "linkedin_url": "https://www.linkedin.com/in/ada-lovelace", "email": "ada@acme.com", "phone": "+33600000000", "company_name": "Acme", "company_domain": "acme.com" } ] } ``` The same record written as `lonescale_first_name`, `main_email` and so on is equivalent. # Brief one contact Source: https://docs.lonescale.com/api-reference/endpoint/brief POST /brief Writes the outreach brief of **one person**: why write to them now (the hook), an email draft and a LinkedIn message, grounded in your CRM history (the person, their account, past exchanges, deals, tickets) and their profile. The drafts follow the skills and the email templates your organisation set in LoneScale. The CRM record id is the best input. Without it the person is looked up by email, then by LinkedIn URL; a person your CRM does not know still gets a brief when you give their current job title or company, or LoneScale holds their profile. Otherwise the brief comes back `failed` with what to add, and an unknown `crm_contact_id` comes back `failed` too. A brief takes 30 to 90 seconds. The request waits up to 45 seconds: it answers `200` with the brief when it is written in time, else `202` with `status: "running"` and the run `id` to read on `GET /brief/runs/{id}`. When an admin picked the fields for it (Chrome extension settings), the email draft is also written to the CRM record: see `crm_save`. Requires the AI assistant to be enabled for the API key's holder. No credits are charged. Rate limited to **10 requests per minute**. # Brief many contacts Source: https://docs.lonescale.com/api-reference/endpoint/brief-bulk POST /brief/bulk Writes the outreach brief of **many people** in one run: up to 100 `contacts`, or the contacts of a HubSpot list (segment) given as `hubspot_list_id`, 100 at a time (pass the returned `next_after` as `after` to run the next page). Answers at once with the run `id`. The briefs are written in the background, a few at a time, about a minute each. Read the run on `GET /brief/runs/{id}`. `language`, `focus` and `custom_details` apply to every contact that does not set its own. When an admin picked the fields for it (Chrome extension settings), each email draft is written to its CRM record, where a CRM workflow or a sequence can start from it. Requires the AI assistant to be enabled for the API key's holder. No credits are charged. Rate limited to **5 requests per minute**. # Get a brief run Source: https://docs.lonescale.com/api-reference/endpoint/brief-run GET /brief/runs/{id} Reads a run started with `POST /brief` or `POST /brief/bulk`: how many briefs are written, failed and pending, and each finished contact's hook, drafts, red flags and CRM save. `status` is `running` while a contact is pending. A run is read by the API key that started it, and kept **7 days**. Rate limited to **60 requests per minute**. # Search Company Source: https://docs.lonescale.com/api-reference/endpoint/companies-search GET /companies/search Resolve a single company by domain, LinkedIn id, LinkedIn slug, or name and return a stable, fixed-shape result. At least one of `domain`, `linkedin_id`, `slug`, or `name` is required. The response always returns the same set of fields — `null` (or `[]` for arrays) is used for any field we do not have data for, so client integrations can rely on a stable schema. When `enrich=true` and no cached match is found, the API will trigger an on-demand enrichment via data-sync; when `enrich=true` and a result has both a LinkedIn id and a universal name, a function-by-function headcount breakdown is also attached. The optional `custom` map (e.g. `custom[crm_id]=abc-123`) is echoed back unchanged at the top level of the response — useful for correlating results with records on your side. Rate limited to **5 requests per minute**. # Search Contacts Source: https://docs.lonescale.com/api-reference/endpoint/contact-sourcing POST /trigger/contact-sourcing Search Contacts. LoneScale will call your `webhook_url` with this payload once the job is completed. See the [Sourcing payload](/api-reference/webhookpayload/sourcing-payload) documentation for the full webhook schema. # Search Contacts (Sync) Source: https://docs.lonescale.com/api-reference/endpoint/contact-sourcing-sync POST /trigger/contact-sourcing/sync Search contacts synchronously and return results directly in the response — no webhook required. The response contains all sourced contacts in a single call. **Maximum 10 contacts per request.** Rate limited to **5 requests per minute**. **Time budget.** A sync call answers within about 45 seconds. Personas are searched in the order you send them and share the `limit`, so put the most important ones first. When the budget runs out before the limit is reached, the response has `partial: true`: retry with fewer personas, or use the asynchronous endpoint `/trigger/contact-sourcing` with a `webhook_url`, which has no time budget. Only the contacts returned are charged. # Enrich Contacts Source: https://docs.lonescale.com/api-reference/endpoint/create POST /trigger/enrich Start waterfall enrichment for contacts. LoneScale will call your `webhook_url` with this payload once the job is completed. See the [Enrichment payload](/api-reference/webhookpayload/enrichment-payload) documentation for the full webhook schema. # CRM Mapping Preview Source: https://docs.lonescale.com/api-reference/endpoint/crm-mapping GET /crm/mapping Preview which CRM fields a `POST /trigger/crm-sync` will write: the team's resolved contact/company create & update field mappings, the unicity criteria used for matching, and whether creation is enabled. Read-only. # CRM Search Source: https://docs.lonescale.com/api-reference/endpoint/crm-search POST /crm/search Look up contacts and companies in your connected CRM(s) and surface the record owner. Two forms. **Flat**: one contact, with `email`, `linkedin_url`, or a name with a company; the answer is `matches`. **Records**: `contacts` and/or `companies`, the same free-form records as `POST /trigger/crm-sync` (`lonescale_*` keys, bare `company_*` and camelCase aliases, `account_crm_id`), at most 20 in all; each record is searched on its own and answered under its index in `contacts[i]` / `companies[i]`, so you can pre-check the exact payload you are about to sync. Companies are matched, in order, by CRM id, by your company unicity criteria (of the `settings_type` record), by LinkedIn page, by domain, by exact name (`matchedOn` says which). Only connected CRMs are queried. Pipedrive and Sellsy search contacts by email and companies by name only. Each match carries `owned_by_you`, and `caller_crm_links` tells which CRM user the caller is linked to, so a client can say "already yours" vs "owned by X" and warn when a create would go to the default owner. # CRM Sync Source: https://docs.lonescale.com/api-reference/endpoint/crm-sync POST /trigger/crm-sync Push contacts and/or companies directly into your connected CRM. LoneScale creates or updates the records asynchronously, applying the team-level integration field mappings already configured in LoneScale (create/update fields and unicity criteria). No workflow is involved. Record keys must match the LoneScale field keys referenced by your configured mappings (for example `lonescale_first_name`, `lonescale_company_domain`, or any custom key you mapped); see [Available Fields](/api-reference/crm-sync-fields) for the full list. For Salesforce the mapping also decides the object: map only the Lead section and the sync searches, updates or creates Leads instead of Contacts. Set `account_crm_id` on a record to target an existing CRM company by id instead of matching by unicity criteria. Poll `GET /trigger/crm-sync/{id}` with the returned `id`, or pass a `webhook_url` to be called once with the run summary when every record has been processed. # CRM Sync Delivery Log Source: https://docs.lonescale.com/api-reference/endpoint/crm-sync-records GET /trigger/crm-sync/{id}/records Delivery log of a CRM sync run: one entry per record with its final status (`synced` / `failed` / `pending`), the CRM ids created or updated, the error message when it failed and the number of attempts. Records not consumed yet (run still processing) are reported as `pending`. # CRM Sync Status Source: https://docs.lonescale.com/api-reference/endpoint/crm-sync-status GET /trigger/crm-sync/{id} Get the status and progress counters of a CRM sync run. # Enrich Contacts (Sync) Source: https://docs.lonescale.com/api-reference/endpoint/enrich-sync POST /trigger/enrich/sync Enrich contacts synchronously and return results directly in the response — no webhook required. The response contains all enriched contacts in a single call. **Maximum 10 contacts per request.** Rate limited to **5 requests per minute, counted per API key** — contact us if your integration needs a higher limit, it can be raised per account. # Contact Enrichment History Source: https://docs.lonescale.com/api-reference/endpoint/enrichment-history GET /contacts/{identifier}/enrichment-history The last enrichment LoneScale holds for a contact, so you can keep your own long-lived cache and skip an enrichment you have already paid for. **This is a per-contact record, not a log of your calls.** Three limits follow from that, worth reading before you build on it: - At most **one entry per contact**: the latest state we know, not one entry per `/trigger/enrich` call. `providers` and `credits` are therefore not returned, since they are not retained per contact. - An enrichment that **found nothing leaves no entry**. A contact we searched and missed is indistinguishable from one we never searched: both return an empty `data`. - A hit on the 24h enrichment cache does **not** refresh `date`. It is the date of the last enrichment that actually ran, which is the date your cache should key on. The history is scoped to your API key: you only ever read contacts your own account enriched. # Get user information Source: https://docs.lonescale.com/api-reference/endpoint/get GET /users Get profile information # Add an item to a list Source: https://docs.lonescale.com/api-reference/endpoint/lists-add-item POST /lists/{listId}/item Add an item to a list. **Validation rules by entity type:** - **COMPANY**: must include `domain` OR both `name` and `location`. - **PEOPLE**: must include at least 2 of: `linkedin_url`, `name`, `location`, `first_name`, `last_name`, `full_name`, `company_name`, `current_position`. # Create a list Source: https://docs.lonescale.com/api-reference/endpoint/lists-create POST /lists Create a new imported list. # Delete a list Source: https://docs.lonescale.com/api-reference/endpoint/lists-delete DELETE /lists/{listId} Delete a list. The list must not be actively used by any workflows. # Remove an item from a list Source: https://docs.lonescale.com/api-reference/endpoint/lists-delete-item DELETE /lists/{listId}/item/{itemId} Remove an item from a list. # Get a list Source: https://docs.lonescale.com/api-reference/endpoint/lists-get GET /lists/{listId} Retrieve a specific list by ID. # Get all lists Source: https://docs.lonescale.com/api-reference/endpoint/lists-get-all GET /lists Retrieve a paginated list of imported lists for the authenticated user, optionally filtered by entity type. # Get list items Source: https://docs.lonescale.com/api-reference/endpoint/lists-get-items GET /lists/{listId}/items Retrieve paginated items from a specific list. # Assign an account Source: https://docs.lonescale.com/api-reference/endpoint/todays-accounts-assign POST /todays-accounts/assign Makes a sales rep the CRM owner of one of the listed accounts (the HubSpot company or the Salesforce Account), and of its highlighted contact too with `with_contact: true`. Writes to your CRM. Returns the list with the account's new owner. # Dismiss an account Source: https://docs.lonescale.com/api-reference/endpoint/todays-accounts-dismiss POST /todays-accounts/dismiss Skips one of the listed accounts for the whole organization. The CRM is not touched. `reason` says what happens next: `BAD_TIMING` (default) and `OTHER` hide it until a newer signal arrives on it; `IN_PROGRESS` hides it for 90 days whatever comes; `NOT_ICP` hides it and, once two accounts of the same industry were dismissed this way, takes 2 points off that industry's accounts in the ranking; `WRONG_CONTACT` keeps the account, never proposes that person on it again and swaps in the next contact. Rate limited to **30 requests per minute**. # Enrich the contact Source: https://docs.lonescale.com/api-reference/endpoint/todays-accounts-enrich POST /todays-accounts/enrich Finds the missing email and phone of one person of a listed account (`person`: the `crm_id` or `linkedin_url` of one of `people[]`; the first when omitted), right away (it can take up to a minute). Runs the same waterfall as the enrichment endpoints and consumes credits **only when something is found**. When the person is a contact of your CRM, the email and phone are written to it; nothing is created otherwise. Returns the list with the person's email and phone. Rate limited to **10 requests per minute**. # Find people Source: https://docs.lonescale.com/api-reference/endpoint/todays-accounts-find-people POST /todays-accounts/find-people Finds up to 3 people matching your organization's persona at one of the listed accounts, right away (it can take up to a minute), and adds them to its `people[]`. Runs the same contact sourcing as `POST /trigger/contact-sourcing/sync` and consumes **one contact credit per person found**. Found people are kept as LoneScale contacts: later lists show them at no cost. Returns the list with the account's `people[]` updated. Rate limited to **5 requests per minute**. # Get today's accounts Source: https://docs.lonescale.com/api-reference/endpoint/todays-accounts-list GET /todays-accounts The accounts of a CRM book worth working today, best first (10 at most). An account gets in with a LoneScale signal in the last 30 days on its domain (job change, new hire, contact sourced, hiring burst; job postings over 14 days) and no CRM activity in the last 7 days. Each account comes with the signal, the person to reach (with the email and phone already known), its owner, the last touch and a score with the lines it adds up from (`score_parts`). This returns the last list computed for the book. `status: none` means it was never ranked: call `POST /todays-accounts/refresh`, then poll this endpoint while `status` is `pending`. Requires Today's accounts to be enabled for the API key's holder. Rate limited to **30 requests per minute**. # Search sales reps Source: https://docs.lonescale.com/api-reference/endpoint/todays-accounts-owners GET /todays-accounts/owners Searches the CRM owners (sales reps) of the connected CRM by name or email, 20 at most. Use an `id` as `owner_id` to assign an account, or as `scope` to rank that rep's book. Salesforce needs at least 2 letters. # Refresh today's accounts Source: https://docs.lonescale.com/api-reference/endpoint/todays-accounts-refresh POST /todays-accounts/refresh Ranks the book again. The ranking runs in the background (a few seconds to a minute): the answer has `status: pending`; poll `GET /todays-accounts` with the same `scope` until it is `ended`. A refresh while one is running returns the running one. Rate limited to **10 requests per minute**. # Verify Phone Number Source: https://docs.lonescale.com/api-reference/endpoint/verify-phone POST /verify-phone Verify Phone Numbers [Special Access Required] # List Webhooks Source: https://docs.lonescale.com/api-reference/endpoint/webhooks-list GET /webhooks List the platform webhooks configured for your team, so you can pass a `webhook_id` destination to `POST /trigger/crm-sync` (push records without a connected CRM). Deduped by URL. # Contact Enrichment Payload Source: https://docs.lonescale.com/api-reference/webhookpayload/enrichment-payload # Notification Payload Source: https://docs.lonescale.com/api-reference/webhookpayload/notification-payload The JSON event a webhook notification posts after LoneScale finds a signal or syncs it to your CRM A **notification** is a rule attached to a workflow. Its destination is a Slack channel or a webhook. A webhook notification posts **one JSON event per contact** (per account for Job Postings), right after the HubSpot or Salesforce push, so you can trigger your own flow (lead scoring, round-robin assignment, sequence enrollment) as soon as LoneScale creates or updates a record. Create one from the workflow form (**Output & Integration → Notifications → New notification**) or from **Settings → Notifications**. Job Changes, New Hires and Job Postings workflows all accept webhook notifications. > [!TIP] > > **Send test event** in the notification editor posts a sample event to your webhook before any run, so Zapier, Make or n8n can map its fields. A test event has `origin: "test"`: skip it in your flow. ## When an event is sent | Workflow | One event per | Sent | Signal | | - | - | - | - | | Job Changes | contact | Right after the contact's CRM push; when the workflow has no CRM destination, when the change is found | `signal.job_change`, `signal.promotion` | | New Hires | new hire | Right after the new hire's CRM push; when the workflow has no CRM destination, when it is found | `signal.new_hire` | | Job Postings | account and run | Once the run is synced, after the account's CRM push, with every job posting the account matched | `signal.job_posting` | Each event counts as one task in Zapier or Make. ## Triggers A notification fires on two families of triggers. Any selected trigger within a family is enough; when both families are selected, one of each must hold; a family left empty means "any". New Hires and Job Postings notifications select CRM events only: their signal is on every event. | Trigger | Fires when | | - | - | | `crm.contact.created` | LoneScale created the contact | | `crm.contact.updated` | LoneScale sent an update to an existing contact | | `crm.contact.moved` | The imported contact was re-associated to its new company (job change) | | `crm.lead.created` | LoneScale created a Salesforce lead instead of a contact | | `crm.account.created` | LoneScale created the company / account | | `crm.account.updated` | LoneScale sent an update to an existing company / account | | `crm.sync.failed` | The CRM refused the write (validation error, rate limit retries exhausted) | | `signal.job_change` | The contact joined a new company | | `signal.promotion` | The contact has a new title in the same company | | `signal.new_hire` | A new hire was found (New Hires) | | `signal.job_posting` | The account has new job postings (Job Postings) | "Updated" means LoneScale sent a write to the record. A company found while the account update mapping is empty is associated but not written: its action is `unchanged` and no event fires. Job Postings push accounts only: their events have no contact. ## Delivery * `POST` to the webhook URL, `Content-Type: application/json`, with the headers set on the webhook connection. * No answer (timeout, connection reset, DNS), `408`, `425`, `429` and any `5xx` are retried: four attempts in all, 5 s, 30 s and 90 s apart. A `Retry-After` header is honoured up to 2 minutes. Any other `4xx` is not retried. * An endpoint that stays down for three events in a row gets one attempt per event for the rest of the run. * Every delivery is listed in **Logs** (Integrations, type `WEBHOOK`) with the request, the answer and the number of attempts. A delivery that got no answer shows as an error with status `599`. * When the last delivery fails, the webhook shows **Webhook error** in **Integrations → Webhook** and on the notifications that use it, until a delivery or a test succeeds. * Deduplicate on `event_id`: a retry after a timeout or a CRM rate-limit retry can deliver the same event twice. ## Repush Pushing runs to the CRM again from the app (select them in the run history, then **Push**) evaluates the webhook notifications again for every contact or account it pushes, on what this push did: * `origin` is `repush`, and `event_id` ends with `#repush-`, one id per repush. Deduplicating on `event_id` keeps the repush events. * A record the repush finds again never fires `created`: `crm.contact.created` and `crm.account.created` only fire when the repush creates a new record. * A push that fails sends `crm.sync.failed`. * Contacts the CRM settings keep out of the push send nothing, and Slack notifications are not posted again. Branch on `origin` to skip what your flow already did for the run, such as a round-robin assignment. ## Resend notifications **Resend notifications** in the run history (select runs, then **Resend notifications**) sends the webhook notifications of those runs again, **without pushing anything to the CRM**. Use it when your endpoint was down during the run, or to feed a flow you set up afterwards: * Each event is the run's own: same `event_id`, with `origin` set to `replay`. Deduplicating on `event_id` skips what you already processed. * The events say what the run did: a contact the run created is still `created`, and `sync.synced_at` is when the run pushed it. * `owner_id` is the owner the run read. If the run read none (no webhook notification fired for that record), the replay reads it and keeps it for later replays. * Every webhook notification the workflow uses fires, with its triggers as they are now, including one added or edited after the run. A record the run did not notify can therefore get an event. Slack notifications are not posted again. ## Payload ```json theme={null} { "event_id": "run_8f3c#item_2b71#ntf_41", "version": 1, "source": "LoneScale", "origin": "run", "triggers": ["crm.contact.created", "crm.account.updated", "signal.job_change"], "matched": ["crm.contact.created", "signal.job_change"], "notification": { "id": "ntf_41", "title": "Contact created → scoring" }, "workflow": { "id": "wf_c9d4", "title": "Customers – job changes", "type": "CONTACT_TRACKING", "run_id": "run_8f3c" }, "crm": { "type": "hubspot", "hub_id": "2451930", "instance_url": null }, "contact": { "action": "created", "id": "901274", "object": "contact", "url": "https://app.hubspot.com/contacts/2451930/record/0-1/901274", "owner_id": "81234567", "message": "Contact successfully created", "error": null }, "previous_contact": { "action": "updated", "id": "118201", "object": "contact", "url": "https://app.hubspot.com/contacts/2451930/record/0-1/118201", "owner_id": "81234567", "message": null, "error": null }, "account": { "action": "updated", "id": "55310", "object": "company", "url": "https://app.hubspot.com/contacts/2451930/record/0-2/55310", "owner_id": null, "message": "Company successfully updated", "error": null }, "lead": null, "sync": { "status": "synced", "scenario": "update_all", "synced_at": "2026-10-31T09:14:02.000Z", "error": null }, "signal": { "type": "job_change", "from": { "company": "OldCo", "title": "Head of Sales" }, "to": { "company": "NewCo", "title": "VP Sales" } }, "input": { "contact_id": "118201", "email": "m.durand@oldco.com", "linkedin_url": "https://www.linkedin.com/in/mdurand", "company_name": "OldCo", "current_position": "Head of Sales" }, "result": { "full_name": "Marie Durand", "job_title": "VP Sales", "company_name": "NewCo", "company_domain": "newco.io", "change_company": true, "change_job_title": false, "matched_personas": "Sales leader", "main_email": "marie.durand@newco.io" } } ``` A **New Hires** event has the same shape with `signal.type` `new_hire`, no `previous_contact` and an empty `input`. A **Job Postings** event has no `contact`, `previous_contact` nor `lead`, the account's fields in `result` and its job postings in `jobs`: ```json theme={null} { "event_id": "run_51aa#company_93f0#ntf_52", "origin": "run", "triggers": ["crm.account.created", "signal.job_posting"], "matched": ["crm.account.created"], "workflow": { "id": "wf_a1b2", "title": "Hiring SDRs", "type": "REVEAL", "run_id": "run_51aa" }, "contact": null, "account": { "action": "created", "id": "55310", "object": "company", "url": "https://app.hubspot.com/contacts/2451930/record/0-2/55310", "owner_id": "81234567", "message": "Company created", "error": null }, "signal": { "type": "job_posting", "from": { "company": null, "title": null }, "to": { "company": "NewCo", "title": null } }, "result": { "company_name": "NewCo", "company_domain": "newco.io", "matched_job_offers_company_count": 2 }, "jobs": [ { "job_id": "job_7f21", "job_name": "Senior Account Executive", "job_link": "https://careers.newco.io/jobs/7f21" }, { "job_id": "job_7f22", "job_name": "Sales Development Representative", "job_link": "https://careers.newco.io/jobs/7f22" } ] } ``` ### Fields | Field | Description | | - | - | | `event_id` | `run#item#notification`, stable across a retry and a replay. A repush adds `#repush-`, a test starts with `test#` | | `origin` | `run` for the workflow run, `repush` when the run is pushed to the CRM again, `replay` for **Resend notifications**, `test` for **Send test event** | | `triggers` | Every trigger true for this event | | `matched` | The selected triggers that held: why this notification fired | | `crm` | The CRM the workflow syncs to. `hub_id` is the HubSpot portal id, as a string. `null` when the workflow has no CRM destination: the event is sent when the signal is found | | `contact` | The contact record LoneScale wrote. `action` is `created`, `updated`, `unchanged`, `skipped` or `failed` | | `previous_contact` | Only when the job change push created a new contact: the record the contact was imported from, updated with the former-company fields. `null` when LoneScale updated the imported contact itself (moved to its new company, or no company change): `contact` is then that record | | `account` | The company (HubSpot) or account (Salesforce). `object` says which | | `lead` | Salesforce only, when a lead was created or updated instead of a contact | | `owner_id` | On each record: its CRM owner (HubSpot owner id, Salesforce `OwnerId`) read right after the push, `null` when it has none. A replay sends the owner the run read | | `sync` | `status` is `synced`, `failed` or `skipped`; `scenario` is the job change scenario of the CRM settings (Job Changes only); `synced_at` is when the record was pushed (on a replay, the run's push); `error` carries the CRM message on a refusal | | `signal` | The signal that was found: a job change or promotion with the previous and current company and title, a new hire, or new job postings | | `input` | The contact as imported: the `client_*` columns of the workflow, without their prefix (custom columns included) | | `result` | What LoneScale found: the `lonescale_*` columns without their prefix, plus `main_email` / `main_phone` when enriched. Job Postings: the account's fields | | `jobs` | Job Postings only: the job postings the account matched in the run | The `url` of a record is a deep link to HubSpot or Salesforce, built from the ids above, so a flow can open or write back to the record immediately. # Search Contacts Payload Source: https://docs.lonescale.com/api-reference/webhookpayload/sourcing-payload # Authentication Source: https://docs.lonescale.com/authentication You need to include a valid API key in the Authorization header of each request you make to our API. Each request to our API endpoints must include this authorization header. ```bash theme={null} x-api-key: YOUR_API_KEY ``` Your API key can be found on the Lonescale App > Integrations > Public API > [card] [Get my API Key](https://app.lonescale.com/app/integrations) Be sure to replace YOUR_API_KEY with the actual API key. Without a valid API key in your request, you will not be able to access the API endpoints and will receive a 401 Unauthorized response. Keep your API key secure and do not share it publicly. # lonescale companies search Source: https://docs.lonescale.com/cli/companies-search Look up a single company on LoneScale by name, domain, LinkedIn slug, or LinkedIn ID. Returns one fixed-shape company profile (every field is always present, with `null` / `[]` for missing data). This is a synchronous call — results come back inline. ## Synopsis ```bash theme={null} lonescale companies search [--name ] [--domain ] [--linkedin-id ] [--slug ] [--enrich] [--custom ] ``` At least one of `--name`, `--domain`, `--linkedin-id`, `--slug` is required. ## Examples ```bash theme={null} # By domain lonescale companies search --domain stripe.com # By LinkedIn slug, with function-by-function headcount lonescale companies search --slug stripe --enrich # By name (partial match) lonescale companies search --name "Anthropic" # Attach custom passthrough metadata lonescale companies search --domain stripe.com \ --custom '{"campaign":"q2-pipeline","owner":"yann"}' ``` ## Options | Option | Description | | - | - | | `--name ` | Company name (partial match). | | `--domain ` | Company website domain. | | `--linkedin-id ` | LinkedIn company numeric ID. | | `--slug ` | LinkedIn universal name — the slug from `linkedin.com/company/`. | | `--enrich` | Fall back to live LoneScale enrichment if the company isn't cached, and fetch the function-by-function headcount. | | `--custom ` | Flat key/value JSON object. Echoed unchanged at the top of the response — useful for joining results back to a row id in your CRM / spreadsheet. | Plus all [global options](/cli/overview#global-options). ## Response shape ```json theme={null} { "linkedinId": "stripe", "linkedinUrl": "https://www.linkedin.com/company/stripe", "name": "Stripe", "domain": "stripe.com", "industry": "Financial Services", "staffCount": 8000, "headcount": { "engineering": 2400, "sales": 600, "marketing": 250 } } ``` Without `--enrich`, `headcount` is `null` for companies that haven't been previously enriched. > [card] [See the underlying endpoint](/api-reference/endpoint/companies-search) > > `GET /companies/search` # lonescale enrich Source: https://docs.lonescale.com/cli/enrich Trigger waterfall enrichment (email and/or phone) for a list of contacts. By default the command is asynchronous — it returns a job ID immediately and you poll for results via [`lonescale result`](/cli/result), or pass `--wait` to have the CLI block until the job finishes. ## Synopsis ```bash theme={null} lonescale enrich --type [--contacts | --contacts-inline ] [options] ``` ## Examples ```bash theme={null} # From a JSON file, polling until done lonescale enrich --type email,phone --contacts contacts.json --wait # Inline JSON for a single contact lonescale enrich --type email --contacts-inline '[ { "firstname": "John", "lastname": "Doe", "domain": "acme.com" } ]' # Sync mode (returns results directly, rate-limited to 5 req/min) lonescale enrich --type email --contacts contacts.json --sync # Pipe from stdin (any source that produces a JSON array of contacts) cat contacts.json | lonescale enrich --type email ``` ## Options | Option | Description | | - | - | | `--type ` | **Required.** Comma-separated enrichment types: `email`, `phone`, or `email,phone`. | | `--contacts ` | Path to a JSON file containing the contacts array. | | `--contacts-inline ` | Inline JSON array (use when piping or scripting). | | `--custom ` | Custom metadata JSON, echoed back in the result and any webhook payload. | | `--wait` | Poll until the job completes. Default timeout is 120 s. | | `--sync` | Use the synchronous endpoint. Returns results inline but is rate-limited to 5 requests / minute. | | `--timeout ` | Override the `--wait` / `--sync` timeout (default 120). | Plus all [global options](/cli/overview#global-options) (`--api-key`, `--output`, `--debug`). ## Contact schema ```json theme={null} [ { "firstname": "John", "lastname": "Doe", "email": "john@acme.com", "job_title": "CTO", "linkedin_url": "https://linkedin.com/in/johndoe", "domain": "acme.com", "company_name": "Acme Inc" } ] ``` Each contact needs at least one identifier: `linkedin_url`, or `firstname` + `lastname` + (`domain` or `company_name`), or `email` alone. Every other field is optional — but more context means better match accuracy. > [!NOTE] > > **Email as a standalone identifier.** An `email` sent on its own resolves the person behind it — name, LinkedIn URL, job title, company — as long as `enrichment_type` includes `profile`. Add `email` / `phone` to the same request to also get their contact details. > [!NOTE] > > **Predicted email fallback.** For `email` enrichment, if no provider returns an email, the result falls back to a pattern-based **predicted email** built from the contact's name and company `domain`. It is returned with `most_probable_email_status: "predicted"` (and an `emails[]` entry with the same status), alongside `predicted_email`, `email_pattern` (e.g. `firstname.lastname@domain`), and `predicted_email_score`. Predicted emails are **free** — they don't consume enrichment credits. Provide a `domain` to enable this fallback. ## Async vs sync at a glance | Mode | When to use | Tradeoff | | - | - | - | | **Async (default)** | Production workloads, batches > 5 contacts, anything you can poll | Returns a job ID; you poll `lonescale result ` or pass `--wait`. | | **Async + `--wait`** | Scripts that want a single blocking call | CLI does the polling for you. Hits the `--timeout` if the job takes longer. | | **Sync (`--sync`)** | Single-contact quick checks, exploration | 5 req/min hard rate limit per account; not for batches. | > [card] [See the underlying endpoints](/api-reference/endpoint/create) > > `POST /trigger/enrich` (async) and `POST /trigger/enrich/sync` (sync). # Overview Source: https://docs.lonescale.com/cli/overview The **LoneScale CLI** (`lonescale`) is the official command-line client for the LoneScale Public API. Use it to enrich contacts, source contacts by persona, look up companies, and poll async jobs — all from your terminal or a shell script. It's a thin wrapper around the same REST endpoints documented under [API Reference](/authentication), with terminal-friendly output, file/stdin/inline input, and built-in polling. ## Install ```bash theme={null} npm install -g @lonescale/cli ``` Or run without installing: ```bash theme={null} npx @lonescale/cli --help ``` Requires Node.js ≥ 18. ## Authenticate Get your API key from **Dashboard → Integrations → Public API** and provide it in one of three ways (checked in this order): **1. Per-command flag (highest priority)** ```bash theme={null} lonescale enrich --api-key ls_xxx ... ``` **2. Environment variable** ```bash theme={null} export LONESCALE_API_KEY=ls_xxx lonescale enrich ... ``` **3. Config file** ```bash theme={null} mkdir -p ~/.lonescale echo '{ "api_key": "ls_xxx" }' > ~/.lonescale/config.json ``` > [card] [Get my API key](https://app.lonescale.com/app/integrations) ## Commands | Command | Purpose | | - | - | | [`lonescale enrich`](/cli/enrich) | Waterfall enrichment (email / phone) for a list of contacts | | [`lonescale source`](/cli/source) | Source contacts at a company by persona, seniority, location | | [`lonescale companies search`](/cli/companies-search) | Look up a single company by name, domain, LinkedIn slug, or ID | | [`lonescale result`](/cli/result) | Poll the status / result of an async job | ## Global options These flags work with every command: | Option | Description | | - | - | | `--api-key ` | LoneScale API key (overrides env + config file) | | `--output ` | `json` (default when piped), `table` (default in TTY), or `minimal` (just the id/status — script-friendly) | | `--debug` | Print HTTP requests / responses to stderr. API keys are redacted automatically. | ## Output formats Data goes to **stdout**, logs go to **stderr** — so you can pipe results cleanly into `jq`, `xargs`, `tee`, etc. ```bash theme={null} # Count returned contacts lonescale source --domain acme.com --personas p.json --wait --output json \ | jq '.contacts | length' # Capture just the job ID JOB_ID=$(lonescale enrich --type email --contacts c.json --output minimal) ``` See [Recipes](/cli/recipes) for more scripting patterns. # Recipes Source: https://docs.lonescale.com/cli/recipes Real-world scripting patterns that combine the CLI commands. All examples assume `LONESCALE_API_KEY` is already exported (see [Overview → Authenticate](/cli/overview#authenticate)). ## Fire and poll The async pattern, broken into two explicit steps: ```bash theme={null} JOB_ID=$(lonescale enrich --type email --contacts contacts.json --output minimal) echo "Started job $JOB_ID" lonescale result "$JOB_ID" --poll --output json > results.json ``` Or condensed into a single blocking call: ```bash theme={null} lonescale enrich --type email --contacts contacts.json --wait --output json > results.json ``` ## Batch enrichment across multiple files ```bash theme={null} mkdir -p results for file in contacts/*.json; do echo "Processing $file..." lonescale enrich --type email --contacts "$file" --wait --output json \ > "results/$(basename "$file")" done ``` ## Pipe sourcing → enrichment Source contacts at a company, then immediately enrich the LinkedIn URLs: ```bash theme={null} lonescale source --domain figma.com \ --personas-inline '[{"name":"Eng","job_titles":["engineering manager"]}]' \ --locations US --limit 10 --wait --output json \ | jq '[.contacts[] | { firstname, lastname, linkedin_url }]' \ | lonescale enrich --type email --wait --output json \ > figma-eng-emails.json ``` ## Filter with `jq` ```bash theme={null} # Just the names + most probable email lonescale source --domain acme.com \ --personas-inline '[{"name":"Sales","job_titles":["VP Sales","Head of Sales"]}]' \ --wait --output json \ | jq '.contacts[] | { name: (.firstname + " " + .lastname), email: .most_probable_email }' ``` ## Look up a list of companies ```bash theme={null} # domains.txt — one domain per line while read domain; do lonescale companies search --domain "$domain" --output json done < domains.txt | jq -s '.' # combine into a single JSON array ``` ## Debug mode Pass `--debug` to print every HTTP request and response to stderr. API keys are redacted automatically. ``` $ lonescale enrich --type email --contacts c.json --debug --wait [DEBUG] POST https://public-api.lonescale.com/trigger/enrich [DEBUG] Body: { "enrichment_type": ["email"], "contacts": [...] } [DEBUG] Response: 200 { "id": "abc-123", "status": "..." } [INFO] Job abc-123 started, polling... [DEBUG] GET https://public-api.lonescale.com/trigger/run/abc-123 [DEBUG] Response: 200 { "status": "processing" } [DEBUG] GET https://public-api.lonescale.com/trigger/run/abc-123 [DEBUG] Response: 200 { "status": "finished", "contacts": [...] } ``` Because logs go to stderr and data goes to stdout, you can debug a pipeline without polluting the JSON output: ```bash theme={null} lonescale enrich --type email --contacts c.json --debug --wait --output json 2> debug.log | jq '.contacts | length' ``` ## CI / cron usage ```yaml theme={null} # Example: nightly enrichment in GitHub Actions - name: Enrich new leads env: LONESCALE_API_KEY: ${{ secrets.LONESCALE_API_KEY }} run: | npx -y @lonescale/cli enrich \ --type email,phone \ --contacts ./pipeline/new-leads.json \ --wait --output json > ./pipeline/enriched.json ``` > [card] [Need something else?](mailto:happy@lonescale.com) > > Tell us your use case at [happy@lonescale.com](mailto:happy@lonescale.com). # lonescale result Source: https://docs.lonescale.com/cli/result Retrieve the status and result of an async job started by [`lonescale enrich`](/cli/enrich) or [`lonescale source`](/cli/source). ## Synopsis ```bash theme={null} lonescale result [--poll] [--interval ] [--timeout ] ``` ## Examples ```bash theme={null} # One-shot status check lonescale result abc-123 # Poll every 5 seconds until the job finishes, max 3 minutes lonescale result abc-123 --poll --interval 5 --timeout 180 # Capture only the final JSON for further processing lonescale result abc-123 --poll --output json > results.json ``` ## Options | Option | Description | | - | - | | `` | **Required.** The job ID returned by `enrich` or `source`. | | `--poll` | Keep polling until the job finishes (or until `--timeout` expires). | | `--interval ` | Seconds between polls (default 3). | | `--timeout ` | Max wait time before giving up (default 120). | Plus all [global options](/cli/overview#global-options). ## Exit codes | Code | Meaning | | - | - | | `0` | Job finished successfully (or status was returned without `--poll`). | | `1` | Job failed, timed out, or the CLI couldn't reach the API. Inspect stderr for details. | This means you can chain `lonescale result` safely in shell scripts: ```bash theme={null} JOB_ID=$(lonescale enrich --type email --contacts c.json --output minimal) if lonescale result "$JOB_ID" --poll --output json > results.json; then echo "Enrichment ready in results.json" else echo "Job failed — check the logs" fi ``` # lonescale source Source: https://docs.lonescale.com/cli/source Source contacts at a company by persona, seniority level, and location. Like [`enrich`](/cli/enrich), it is async by default — pass `--wait` to block until the job completes, or call [`lonescale result`](/cli/result) with the returned job ID. ## Synopsis ```bash theme={null} lonescale source --domain [--personas | --personas-inline ] [options] ``` ## Examples ```bash theme={null} # Basic — VP+ at acme.com, all locations lonescale source --domain acme.com \ --personas-inline '[{"name":"Leadership","job_titles":["VP","Head","Director"]}]' \ --seniority vp,head,director \ --wait # Multi-filter with US/UK only, capped at 50 results lonescale source \ --domain acme.com \ --company-name "Acme Inc" \ --company-linkedin "https://linkedin.com/company/acme" \ --personas personas.json \ --locations US,GB \ --seniority c-suite,vp,director \ --limit 50 \ --wait ``` ## Options | Option | Description | | - | - | | `--domain ` | **Required.** Company website domain (e.g. `acme.com`). | | `--personas ` | Path to a JSON file with the personas array. | | `--personas-inline ` | Inline personas array. | | `--company-name ` | Company name. Helpful when the domain is ambiguous. | | `--company-linkedin ` | Company LinkedIn URL. Boosts accuracy by \~25 %. | | `--locations ` | Comma-separated ISO country codes (see list below). | | `--seniority ` | Comma-separated seniority levels (see list below). | | `--limit ` | Max contacts to return. | | `--disable-company-info` | Skip the company enrichment block in the response. | | `--custom ` | Custom metadata JSON, echoed back. | | `--wait` | Poll until the job completes (timeout 120 s by default). | | `--sync` | Use the synchronous endpoint (rate-limited to 5 req/min, about 45 s of search: a cut run is flagged `partial`, list the most important personas first). | | `--timeout ` | Override the `--wait` / `--sync` timeout. | Plus all [global options](/cli/overview#global-options). ## Persona schema ```json theme={null} [ { "name": "Engineering Leaders", "job_titles": ["CTO", "VP Engineering", "Head of Engineering"], "exclude_job_titles": ["Junior", "Intern"] } ] ``` `job_titles` is matched as **partial / fuzzy** — `"VP Engineering"` will pick up `"VP, Engineering"` and `"VP of Engineering"`. Use `exclude_job_titles` to filter out look-alikes. ## Allowed seniority levels `owner`, `founder`, `c-suite`, `partner`, `vp`, `head`, `director`, `manager`, `senior`, `entry`, `intern` ## Allowed location codes `AT`, `AU`, `BE`, `CA`, `CH`, `DE`, `DK`, `ES`, `FI`, `FR`, `GB`, `IE`, `IL`, `IT`, `LU`, `NL`, `NO`, `PT`, `SE`, `US` > [card] [See the underlying endpoints](/api-reference/endpoint/contact-sourcing) > > `POST /trigger/source-contact` (async) and `POST /trigger/source-contact/sync` (sync). # Connect to Claude Source: https://docs.lonescale.com/mcp/connect The LoneScale MCP server can be added to Claude as a **custom connector**. Connection uses OAuth 2.0 — Claude will pop up a LoneScale consent screen where you paste your API key, then Claude stores the access token and reuses it for every tool call. ## Prerequisites * A LoneScale API key — copy it from **Dashboard → Integrations → Public API**. * A Claude account on a plan that supports custom connectors (currently Claude.ai web + Claude Desktop). > [card] [Get my API key](https://app.lonescale.com/app/integrations) ## Add the connector **1. Open Claude settings** In **Claude.ai** → **Settings → Connectors** (or **Claude Desktop → Settings → Connectors**), click **Add custom connector**. **2. Paste the MCP URL** Server URL: ``` https://mcp-enrich.lonescale.com/mcp ``` Name it `LoneScale` (or whatever you'd like to see in the tool picker). **3. Authorize** Claude redirects you to the LoneScale consent screen. Paste your API key and click **Authorize**. You'll be sent back to Claude, and the connector status flips to **Connected**. **4. Try it** Start a new chat and ask Claude something like *"Search LoneScale for the company at stripe.com"*. You should see Claude call `public-api-companies-search` and return the result. Head to [Examples](/mcp/examples) for more. ## OAuth flow under the hood For client implementers (or anyone curious), here's what happens during the consent flow: 1. Claude discovers the server's auth metadata via: * `GET /.well-known/oauth-protected-resource` (RFC 9728) * `GET /.well-known/oauth-authorization-server` (RFC 8414) 2. Claude **dynamically registers** itself via `POST /register` (RFC 7591). It receives a `client_id` scoped to its `redirect_uri` (`https://claude.com/api/mcp/auth_callback`). 3. Claude opens `/authorize?client_id=…&redirect_uri=…&code_challenge=…&code_challenge_method=S256` in your browser. You see the LoneScale consent screen and paste your API key. 4. LoneScale verifies the API key, issues a one-time `code`, and redirects back to Claude with `?code=…&state=…`. 5. Claude exchanges the code at `POST /token` with the PKCE `code_verifier`. The response contains an `access_token` that Claude attaches as `Authorization: Bearer …` to every subsequent `/mcp` call. ## Disconnect To revoke access, open **Settings → Connectors** in Claude and click **Disconnect** on the LoneScale row. Your API key itself stays valid — rotate it in the LoneScale dashboard if you want to invalidate it everywhere. ## Other clients The same server works with any MCP-aware client that supports Streamable HTTP + OAuth, including: * [Cursor](https://docs.cursor.com/context/mcp) — add it under **Settings → MCP → Add custom server**. * Custom agents built with the [Anthropic SDK](https://docs.anthropic.com/) via the `mcp-remote` adapter. ## Troubleshooting | Symptom | Likely cause | Fix | | - | - | - | | `401 Unauthorized` after authorizing | API key was rotated or revoked | Reconnect with a fresh key | | Consent screen says "Unknown client_id" | Stale connector entry | Remove the connector and add it again | | Tool calls hang on async jobs | Webhook delay | Claude will poll `get-job-result`; results usually arrive within 60s for enrichment, a few minutes for sourcing | | Need help | — | Email [happy@lonescale.com](mailto:happy@lonescale.com) | # Examples Source: https://docs.lonescale.com/mcp/examples Three prompts you can paste straight into a Claude chat once the LoneScale connector is connected. Each shows the tool Claude is expected to pick and the rough shape of the answer. ## 1. Look up a company > *"Look up the company at **stripe.com** on LoneScale — I want the name, industry, headcount, and LinkedIn URL."* **What Claude does:** calls `public-api-companies-search` with `domain: "stripe.com"`. **Sample response:** ```json theme={null} { "linkedinId": "stripe", "linkedinUrl": "https://www.linkedin.com/company/stripe", "name": "Stripe", "domain": "stripe.com", "industry": "Financial Services", "staffCount": 8000, "headcount": { "engineering": 2400, "sales": 600, ... } } ``` Add **"and break headcount down by function"** to your prompt and Claude will set `enrich: true`, which returns a function-level breakdown. ## 2. Enrich a list of contacts with email + phone > \_"Here are 3 LinkedIn URLs: > > * [https://www.linkedin.com/in/patrickcollison](https://www.linkedin.com/in/patrickcollison) > * [https://www.linkedin.com/in/johncollison](https://www.linkedin.com/in/johncollison) > * [https://www.linkedin.com/in/cristinacordova](https://www.linkedin.com/in/cristinacordova) > > Enrich each one with email and phone using LoneScale."\_ **What Claude does:** 1. Calls `public-api-enrich` with `enrichment_type: ["email", "phone"]` and the 3 contacts. Gets back a `lonescale_job_id`. 2. Polls `get-job-result` every few seconds until the status flips from `pending` to `ready`. 3. Shows you a table with the enriched email + phone for each contact. Enrichment is **waterfall** — LoneScale tries multiple providers and returns the first hit per contact. Most jobs finish in under 60 seconds. When no provider returns an email, the result falls back to a free **predicted email** built from the contact's name and company domain, flagged with `most_probable_email_status: "predicted"` and accompanied by `predicted_email`, `email_pattern`, and `predicted_email_score`. Predicted emails don't consume credits. ## 3. Source contacts at a company > *"Find 10 engineering managers at **figma.com** based in the US, and show me their LinkedIn URLs and current titles."* **What Claude does:** 1. Calls `public-api-contact-sourcing` with `company_domain: "figma.com"`, `personas: ["engineering manager"]`, `included_locations: ["United States"]`, `limit: 10`. Gets back a `lonescale_job_id`. 2. Polls `get-job-result` until the job is `ready` (sourcing typically takes 1–3 minutes). 3. Returns the list of sourced contacts inline. Chain it with prompt 2 ("…now enrich those 10 contacts with email") and Claude will pipe the LinkedIn URLs from the sourcing result straight into `public-api-enrich`. ## Tips * **Be explicit about LoneScale.** Mentioning "LoneScale" in the prompt makes Claude pick the right connector when you have several connected. * **Don't interrupt async jobs.** While Claude is polling `get-job-result`, don't send a new message — it will lose the `lonescale_job_id` and have to restart. * **Custom metadata.** All tools accept an optional `custom` map that's echoed back in webhook payloads. Useful when you're chaining LoneScale with a CRM update further downstream. # Overview Source: https://docs.lonescale.com/mcp/overview The **LoneScale MCP server** lets AI assistants (Claude, Cursor, ChatGPT, custom agents) call LoneScale's enrichment and sourcing capabilities as tools — directly from a chat, no glue code required. It implements the [Model Context Protocol](https://modelcontextprotocol.io) over Streamable HTTP and authenticates users via OAuth 2.0 with PKCE. Behind the scenes, every tool call uses the same LoneScale Public API documented elsewhere on this site. ## Endpoint ``` https://mcp-enrich.lonescale.com/mcp ``` Transport: **Streamable HTTP** (MCP spec ≥ 2025-06-18). Auth: **OAuth 2.0** (user-consent flow — see [Connect to Claude](/mcp/connect)). ## Available tools The tools below are available once the user has authorized with their LoneScale API key. | Tool | Mode | Description | | - | - | - | | `whoami` | sync | The user behind the API key: name, remaining credits, and `crm_links` (the HubSpot/Salesforce user they are linked to, or `null`). Tells whether a CRM push will be assigned to them or to the default owner. | | `public-api-companies-search` | sync | Look up a company by name, domain, LinkedIn slug, or LinkedIn ID. Returns one fixed-shape company profile. | | `public-api-crm-search` | sync | Look up contacts and companies in the connected CRM(s): one contact by email, LinkedIn URL, or name + company, or `contacts[]` / `companies[]` records in the crm-sync vocabulary, answered per record. Returns matches with owner and `owned_by_you`, plus `caller_crm_links`. | | `public-api-enrich` | async | Trigger waterfall enrichment (email and/or phone) for a list of contacts. Checks the CRM first and stops if the contact already exists. With `sync_to_crm: true` the enriched contact is written to the CRM and assigned to the caller's linked CRM user. Returns a `lonescale_job_id`. | | `public-api-contact-sourcing` | async | Source contacts at a company by persona, seniority, and location. Returns a `lonescale_job_id`. | | `todays-accounts` | sync | The accounts of a CRM book worth working today, best first: where the account is, the signal, the person to reach (email and phone known or not), the owner, whether it is a former customer and the score breakdown. Current customers are left out. Your own book by default, or `all`, `unassigned`, or a rep's. Ranks the book when needed and waits for it. Requires Today's accounts to be enabled. | | `todays-accounts-owners` | sync | Search the CRM owners (sales reps) by name or email, for `assign-account` or to open a rep's book. | | `assign-account` | sync | Make a rep the CRM owner of a listed account, and of its contact (on by default). Writes to the CRM. | | `dismiss-account` | sync | Hide a listed account for the whole team until a new signal arrives. | | `enrich-account-contact` | sync | Find the missing email and phone of a listed account's contact, right away. Consumes credits only when something is found; written to the CRM contact when there is one. | | `public-api-brief` | sync | The outreach brief of one person: why write to them now, an email draft and a LinkedIn message, from the CRM history and their profile, following your organisation's skills and email templates. Best from a CRM contact id; a person the CRM does not know still gets a brief. `custom_details` carries anything that should shape the message. Waits up to 45 seconds, then returns a `run_id`. Requires the AI assistant to be enabled. | | `public-api-brief-bulk` | async | The outreach briefs of up to 100 contacts, or of a HubSpot list, in one run. Returns a `run_id`. When an admin picked the CRM fields for it, each email is saved on its CRM record. | | `public-api-brief-status` | sync | Read a brief run by its `run_id`: counts, and each finished contact's drafts. | | `get-job-result` | sync | Poll for results of an async job using its `lonescale_job_id`. Returns `pending` until status is `ready`. Sourced contacts come back with a `crm` block (existing record + owner, or not in CRM). | Sync tools return results inline. Async tools return a job id immediately and the assistant must call `get-job-result` every few seconds until the status is `ready`. The brief tools have their own status tool: a brief run is read with `public-api-brief-status`. ## What you'll need * A LoneScale account with an API key (Dashboard → Integrations → Public API). * A client that supports MCP custom connectors — for example [Claude](https://claude.ai), [Cursor](https://cursor.sh), or any agent built with the Anthropic SDK. > [card] [Connect to Claude](/mcp/connect) > > Step-by-step setup, including the OAuth consent screen. > [card] [Examples](/mcp/examples) > > Three concrete prompts you can copy-paste into Claude.