# Rexplore Docs > Documentation for Rexplore AI systems: Luso8 Cloud, the Luso8 API and MCP server, Rexplore ID and Voxtra. --- # Introduction (/luso8) > Luso8 Cloud is an AI-native workspace for customer data, outreach, conversations, calls and pipeline, built so a small team can run a full sales and support motion. Luso8 Cloud brings your customer data, outreach, conversations, phone calls and pipeline into one workspace. AI agents work alongside your team: they research leads, draft messages, answer customers on chat and on the phone, and hand off to a person when it matters. ![Luso8 Cloud](/images/luso8-main-page.webp) ## How the workspace is organized [#how-the-workspace-is-organized] Everything lives in the left sidebar, grouped by what you are trying to do. | Area | What you do there | | --- | --- | | **Data** | Keep contacts, companies and lists, find new leads, track website visitors and buying intent, and store the knowledge your AI agents read. | | **Engage** | Work every conversation in one inbox, run multi-step campaigns, configure AI agents and make calls from the dialer. | | **Support** | Put a chat widget on your website, publish help articles, handle support conversations and tickets, and run the call center. | | **Pipeline** | Manage appointments and booking pages. | | **Deals** | Move opportunities from prospect to lead, deal and customer, and track your products. | | **AI tools** | Practice calls with the sales coach, build skills and workflows, and run market research. | | **Content** | Write articles and see reports for every part of the platform. | The logo at the top of the sidebar always takes you **Home**, where the platform assistant answers questions about your workspace and takes actions for you. See [Platform assistant](/luso8/assistant). ## Product areas [#product-areas] ## A typical flow [#a-typical-flow] Most teams start with one part of the platform and grow into the rest. A common loop looks like this: ```mermaid flowchart LR Data["Bring data in
import or lead search"] --> Lists["Group into lists"] Lists --> Reach["Reach out
campaigns, dialer, agents"] Reach --> Inbox["Replies and calls
land in the inbox"] Inbox --> Pipeline["Prospect → lead →
deal → customer"] ``` 1. **Bring data in.** Import contacts from a CSV file, or find new ones with [lead search](/luso8/lead-search). 2. **Group people into lists.** [Lists](/luso8/crm/lists) are how campaigns and the dialer know who to reach. 3. **Reach out.** Run a [campaign](/luso8/campaigns), call through the [dialer](/luso8/call-center/dialer), or let an [AI agent](/luso8/agents) handle inbound conversations. 4. **Work the replies.** Every reply and call lands in the [inbox](/luso8/inbox) with full context. 5. **Track the pipeline.** Interested people move through [deals](/luso8/crm/deals) until they become customers. ## AI that asks before it acts [#ai-that-asks-before-it-acts] AI is built into every area, and it follows the same rule everywhere: anything that creates, changes, sends, schedules or charges is shown to you for an explicit yes first. In the inbox, AI drafts replies for you to review. Campaign copy written by AI is marked for review before launch. Agents only use the parts of Luso8 you switch on for them. ## How it fits with the rest of Rexplore [#how-it-fits-with-the-rest-of-rexplore] - **Rexplore ID** is the account you sign in with. One account works across every Rexplore product, and your password, email and two-step verification are managed there. See [Rexplore ID](/rexplore-id). - **Developers** can read and write workspace data with the [Luso8 REST API](/developers) and connect AI tools such as Claude, ChatGPT and Cursor through the [remote MCP server](/developers/mcp). ## Next steps [#next-steps] Sign up, create your workspace and invite your team. Step-by-step walkthroughs for common jobs. Bring email, WhatsApp, Messenger and Instagram into the inbox. API keys, the REST API and the MCP server. --- # Quickstart (/luso8/quickstart) > Sign up with Rexplore ID, create your Luso8 workspace, invite your team and connect your first channel in about ten minutes. This guide takes you from no account to a working Luso8 workspace with your team invited and your first channel connected. ## Before you begin [#before-you-begin] You need a work email address. If you are joining a workspace someone else created, skip to [Join a workspace you were invited to](#join-a-workspace-you-were-invited-to). ### Create your Rexplore ID [#create-your-rexplore-id] Go to [luso8.rexplore.ai](https://luso8.rexplore.ai) and choose **Sign up**. Luso8 uses [Rexplore ID](/rexplore-id), Rexplore's single account for every product, so you are sent to `auth.rexplore.ai` to create it. - Enter your name, work email and a password of at least 12 characters, or choose **Continue with Google**. - Accept the terms and confirm your email with the 6-digit code we send you. When you are done, you are sent back to Luso8 and signed in. See [Signing in](/rexplore-id/sign-in) for details. ### Create your workspace [#create-your-workspace] The first time you sign in, onboarding asks a few questions and then creates your workspace: | Step | What to enter | | --- | --- | | **Your name** | How teammates and customers see you. Required. | | **Your role** | Your job title. | | **Organization** | Your company name (required) and, optionally, its domain, such as `acme.com`. | | **Industry & team** | Your industry and team size, from *Just me* to *200+*. | | **Your goals** | What you want to do first: automate sales outreach, run marketing campaigns, deploy AI agents, get market intelligence, manage contacts and CRM, or customer support. | | **Review** | Check your answers and create the workspace. | You become the workspace **Owner**. Your goals only tailor the suggestions you see; every feature stays available. ### Invite your team [#invite-your-team] Open **Settings → Workspace → Members**, enter a teammate's email, pick a role and send the invitation. - The default role is **Member**. You can also invite **Administrators** and **Managers**. See [Roles and permissions](/luso8/settings/roles). - Invitations expire after 7 days. Pending invitations are listed, and you can resend or cancel them. - You can change a member's role later from the same list. ### Connect a channel [#connect-a-channel] Bring your customer conversations into the [inbox](/luso8/inbox). Channels are set up under **Settings → Channels**: - **Email**: send from your own domain and receive replies in the inbox. See [Email](/luso8/inbox/email). - **WhatsApp**: connect a WhatsApp Business number. See [WhatsApp](/luso8/inbox/whatsapp). - **Messenger and Instagram**: connect a Facebook Page and its Instagram account. See [Messenger and Instagram](/luso8/inbox/messenger-instagram). - **Website chat**: add the chat widget to your site from **Support → Embed bot**. See [Web chat widget](/luso8/inbox/web-chat-widget). ### Add your first contacts [#add-your-first-contacts] Open **Data → Contacts** and either add people one by one or choose **Import** to upload a CSV file. Companies in the file are linked automatically. To find new people instead, use [lead search](/luso8/lead-search). ## Join a workspace you were invited to [#join-a-workspace-you-were-invited-to] 1. Open the invitation email and follow the link. It looks like `luso8.rexplore.ai/invite/...`. 2. Sign in with your Rexplore ID, or create one with the same email address the invitation was sent to. 3. Accept the invitation. You land in the workspace with the role the inviter chose. Invitations are tied to an email address. If the link says it has expired, ask an Owner or Administrator to resend it. ## Find your way around [#find-your-way-around] - The **sidebar** groups features into Data, Engage, Support, Pipeline, Deals, AI tools and Content. Groups can be collapsed, and the whole sidebar can be folded. - **Home** (the logo) opens the [platform assistant](/luso8/assistant). On other pages, open it from the sparkle button. - **Settings** is in the user menu. It has three tabs: **Account**, **Workspace** and **Channels**. - **Help → Documentation** opens the in-app guide. ## Next steps [#next-steps] --- # Contacts (/luso8/crm/contacts) > Keep every person you work with in one place, with custom fields, CSV import and export, AI enrichment and a full history of conversations. Contacts are the people you sell to and support. Every email, chat, call, ticket and deal links back to a contact, so anyone on your team can open a person and see the whole relationship. Find them under **Data → Contacts**. ## Add contacts [#add-contacts] There are three ways to get people in: - **Add one.** Choose **Add contact** and fill in what you know. You can add more details at any time. - **Import a CSV file.** Choose **Import**, upload your file and map its columns to contact fields. If a row has a company name, the contact is linked to that [company](/luso8/crm/companies), and the company is created if it does not exist yet. - **Find new people.** Use [lead search](/luso8/lead-search) to discover people who match your ideal customer, then add the results to your CRM. Contacts are also created for you when someone new writes to you on a connected channel or books a meeting. ## The contacts table [#the-contacts-table] The table is built for working large lists quickly: - **Filters** narrow the list by status, country, enrichment status, list membership and more. - **Columns** lets you choose which fields are visible, including your custom fields. - **Search** matches names, emails, phone numbers and companies. - **Export CSV** downloads the current view, including large exports of more than 100 rows. ### Bulk actions [#bulk-actions] Select contacts to act on many at once: | Action | What it does | | --- | --- | | **Enrich** | Fills in missing details, such as job title, phone and social profiles, from public sources. | | **Add to list** | Adds the selection to a [list](/luso8/crm/lists) for campaigns or the dialer. | | **Move to pipeline** | Creates [prospects](/luso8/crm/deals) from the selected contacts. | ## Contact statuses [#contact-statuses] | Status | Meaning | | --- | --- | | **Active** | A normal, reachable contact. | | **Inactive** | Kept for history but not being worked. | | **Unsubscribed** | Asked not to receive marketing. Campaigns skip them. | | **Bounced** | Email to this contact bounced. Campaigns skip email steps for them. | ## The contact page [#the-contact-page] Open a contact to see everything about them. - **Identity**: name, emails, phone numbers, job title, company, country and social links. - **Lists**: the lists the contact belongs to. - **Custom info**: your workspace's custom fields. Tabs along the top show related records: **Prospects**, **Leads**, **Deals**, **Customers**, **Conversations**, **Tickets** and **Activity**. From here you can start a conversation, call the contact, or create a deal. ## Custom fields [#custom-fields] Every business tracks something different. Add your own fields from the contacts page with **Manage custom fields**. Custom fields appear on each contact under **Custom info**, can be shown as table columns and filled in during a CSV import. Custom fields used to live in Settings. They now open in a drawer right on the Contacts page. ## Website visitors and intent [#website-visitors-and-intent] Two more pages under **Data** help you spot the warmest contacts first. - **Visitors** shows who is browsing your website. Open the **Setup** tab to copy a tracking script for your site and choose what to track: page views, clicks, form submissions, file downloads, scroll depth and outbound links. Privacy switches let you anonymize IP addresses, require cookie consent, respect *Do Not Track* and automatically identify visitors who fill in forms. - **Intents** lists buying signals from identified contacts, with the total number of signals, how many are high intent and the average confidence, over the time range you choose. ## Work with contacts through the API [#work-with-contacts-through-the-api] You can create, read, update and delete contacts from your own systems with the [Luso8 REST API](/developers/api-reference). See the [sync contacts guide](/developers/guides/sync-contacts) for a complete example. ## Related [#related] The accounts your contacts belong to. Group contacts for campaigns and calling. Turn contacts into customers. Find new contacts with AI. --- # Companies (/luso8/crm/companies) > Track the organizations your contacts work for, enrich them with AI and see every deal, prospect and customer record for an account. Companies are the accounts your contacts belong to. Linking people to companies gives you account context everywhere: on a contact, on a deal and in the inbox. Find them under **Data → Companies**. ## Add companies [#add-companies] - **Add one** with **Add company**. Country is a searchable list. If your industry is not listed, choose **Other** and type your own. - **Import a CSV file** to add many at once. - **Create them on the fly.** When you type a company name that does not exist yet while creating a contact, prospect, lead or deal, Luso8 creates the company for you. ## The companies table [#the-companies-table] The companies table works like the [contacts](/luso8/crm/contacts) table: choose visible columns, filter, search and import. ### Find people at these companies [#find-people-at-these-companies] Select one or more companies and choose **Find people at these companies**. This opens [lead search](/luso8/lead-search) already pointed at those accounts, so you can find decision makers to contact. ## Enrich with AI [#enrich-with-ai] AI enrichment researches a company on the public web and fills in its profile: industry, size, location, website, description and more. 1. Open a company, or select several in the table. 2. Choose **Enrich**. 3. Pick the fields you want filled. Fields you leave unchecked are not changed. 4. Review the result. If saving a field fails, you can retry it without running the whole enrichment again. Enrich before you run a campaign. Better company data means better AI-written messages and more accurate filters. ## The company page [#the-company-page] The company page brings an account together: - **Stats**, such as the total value of won deals and the products the company has bought. - Tabs for **Deals**, **Prospects**, **Leads** and **Customers** linked to the company. - The contacts who work there. Every prospect, lead, deal and customer in Luso8 is linked to a company. See [Deals and pipeline](/luso8/crm/deals) for how records move between these stages. ## Related [#related] The people at each company. Opportunities linked to a company. Find new companies and people. Manage companies from your own code. --- # Deals and pipeline (/luso8/crm/deals) > Move opportunities from prospect to lead, deal and customer, manage products and services, and collect payment with hosted payment links. The **Deals** group in the sidebar is your sales pipeline. It follows a person from first outreach to paying customer, with a separate view for each stage, plus your catalog of products and a dashboard for sales development. ## The pipeline model [#the-pipeline-model] Every opportunity moves through the same stages: ```mermaid flowchart LR Contact --> Prospect --> Lead --> Deal --> Customer ``` | Stage | What it means | Where to find it | | --- | --- | --- | | **Contact** | A person in your CRM. | Data → Contacts | | **Prospect** | Someone you are actively reaching out to. | Deals → Prospects | | **Lead** | A prospect who has shown interest and is being qualified. | Deals → Leads | | **Deal** | A qualified opportunity with a value and a stage. | Deals → Deals | | **Customer** | An account that has bought from you. | Deals → Customers | Every prospect, lead, deal and customer is linked to a [company](/luso8/crm/companies) and a contact. When you create a record, the shared form asks for the company, the contact and an owner. If you type a company or person that does not exist yet, Luso8 creates them. You can promote records along the pipeline at any time: move contacts in bulk into prospects from the contacts table, promote a prospect to a lead, create a deal from a lead, and close a won deal as a customer. ## Prospects [#prospects] Prospects are people you are working with outreach. Their statuses are: **Active**, **Engaged**, **Proposal**, **Negotiation**, **On hold**, **Closed won** and **Closed lost**. ## Leads [#leads] Leads are prospects who have raised a hand. Use **Add lead** to create one directly. Lead statuses: | Status | Meaning | | --- | --- | | **New** | Just created, not yet contacted. | | **Contacted** | You have reached out. | | **Qualified** | A real opportunity. Ready to become a deal. | | **Unqualified** | Not a fit right now. | | **Nurturing** | Not ready yet; keep in touch. | | **Converted** | Turned into a deal. | | **Lost** | No longer an opportunity. | ## Deals [#deals] Deals carry a value, an owner, a priority and a stage. Use **Add deal** to create one, or create it from a lead or straight from an inbox conversation. ### Stages [#stages] | Stage | Typical use | | --- | --- | | **Qualification** | Confirm need, budget and timing. | | **Discovery** | Understand requirements in depth. | | **Proposal** | A proposal or quote has been sent. | | **Negotiation** | Agreeing terms. | | **Closed won** | The customer said yes. | | **Closed lost** | The opportunity is over. | Deal priority is **Low**, **Medium**, **High** or **Critical**. ### The deal page [#the-deal-page] A deal has four tabs: - **Overview**: value, stage, owner, company, contact and key dates. - **Activity**: the history of changes and touchpoints. - **Inbox**: the conversations linked to the deal. - **Products**: the products and services on the deal. ### Payment links [#payment-links] You can collect payment from a deal with a hosted payment link. Generate the link on the deal and send it to the customer, by email, in a chat or during a call. The default payment provider is set in **Settings → Channels → Payments**. ## Customers [#customers] Customers are accounts that have bought. Close a won deal as a customer to keep the history together. Customer statuses: **Active**, **At risk**, **Churned**, **Expansion** and **Inactive**. ## Products and services [#products-and-services] **Deals → Products** is your catalog. Products can be attached to deals and pushed onto a deal from an inbox conversation. | Field | Options | | --- | --- | | **Type** | One-time, Recurring, Usage based, Service | | **Status** | Active, Draft, Archived | ## SDR dashboard [#sdr-dashboard] **Deals → SDR dashboard** is a view for sales development teams. It shows your lead funnel, the prospect pipeline, the most common loss reasons and the pain points prospects mention. ## Related [#related] Start the pipeline from your contacts. Create deals from conversations. Reach prospects at scale. Automate what happens when a deal is won. --- # Lists (/luso8/crm/lists) > Group contacts into reusable lists that campaigns, the dialer and your team work through. A list is a saved group of contacts. Lists are the unit of work for outreach: [campaigns](/luso8/campaigns) enroll a list, and the [dialer](/luso8/call-center/dialer) calls through one. Make lists by segment, territory, event or campaign so you can reuse them. Find them under **Data → Lists**. ## Create a list [#create-a-list] 1. Open **Data → Lists** and choose **Create list**. 2. Give it a clear name, such as *Lagos fintech decision makers* or *Webinar attendees, March*, and an optional description. 3. Save it, then add contacts. ## Add and remove contacts [#add-and-remove-contacts] You can add contacts from several places: - **From the list.** Open the list and choose **Add contacts**. Search by name, email, phone or company and pick the people you want. - **From the contacts table.** Select contacts, then choose **Add to list** in the bulk actions. - **From the API.** Use the [lists endpoints](/developers/api-reference) to keep a list in sync with your own systems. To remove someone, open the list and remove them from it. The contact itself is not deleted. A contact can be on any number of lists. ## Use lists [#use-lists] | Where | How lists are used | | --- | --- | | [Campaigns](/luso8/campaigns) | Enroll every contact on one or more lists in a sequence. | | [Dialer](/luso8/call-center/dialer) | Call through a list, one contact after another. | | [Contacts](/luso8/crm/contacts) | Filter the table to people on, or not on, specific lists. | Campaign steps can also add a contact to a list or remove them from one, for example to move everyone who replied into a *Hot leads* list. ## Tips [#tips] - **Keep lists focused.** A list per audience makes AI-written messages more relevant and results easier to compare. - **Name lists for their purpose**, not the date you made them. - **Clean before you send.** Filter out unsubscribed and bounced contacts first. Campaigns skip them anyway, but your counts will be accurate. --- # Lead search (/luso8/lead-search) > Describe the companies or people you want to reach and let AI agents search the public web, grade the results and find contact details. Lead search finds new companies and people that match your ideal customer. You describe who you are looking for in plain language. A team of AI agents plans web searches, collects candidates, removes duplicates, grades the results against your brief and looks up published contact details. You review the results and add the good ones to your CRM. Open it from **Data → ICP**, then the **Lead Search** tab. ## Run a search [#run-a-search] ### Describe who you are looking for [#describe-who-you-are-looking-for] Write a short brief, for example *"Logistics companies in Kenya and Tanzania with 50 to 500 employees that run their own delivery fleet"*. Choose whether you want **Companies** or **People**. ### Set the options [#set-the-options] | Option | What it does | | --- | --- | | **Industry** | Focus the search on one industry. | | **Company size** or **Role** | Company size for company searches; job role for people searches. | | **Country** | Where results must be based. Results outside it are dropped. | | **Minimum match** | How closely a result must match your brief to be kept. | | **Approve the plan first** | Pause after planning so you can review the searches before they run. | | **Ask me when quality is short** | Pause and ask you what to do if the results fall short of the target. On by default. | ### Review the plan (optional) [#review-the-plan-optional] The agents plan 15 to 25 web searches. With **Approve the plan first** on, you see the plan before anything runs. You can approve it, edit it (one search per line, plus optional guidance for the agents), or cancel. ### Let the agents work [#let-the-agents-work] The agents search the public web, extract companies or people, drop duplicates and results outside your geography, and keep searching until they reach the target number of results. The default target is 50. Each run is checked against six criteria: **on brief**, **identifiable**, **contactable**, **no duplicates**, **coverage** and **clear descriptions**. Then parallel workers look up published contact details; you see *Enriching contacts* while this happens. ### Add results to your CRM [#add-results-to-your-crm] Each result card has an **Add** button that creates the company or contact in your CRM. To use the new contacts in a campaign, add them to a [list](/luso8/crm/lists) from the contacts table. ## When quality is short [#when-quality-is-short] If the results do not meet the target and **Ask me when quality is short** is on, the search pauses with a review card. It shows the gaps, such as missing contact details or too few results in a country, and suggests more searches. You can: - **Accept** the results as they are. - **Keep searching**, optionally with your own queries or a note for the agents. - **Stop** the search. A paused search shows as *needs you* in the activity menu and survives a page refresh, so you can come back to it later. ## Past searches and quality [#past-searches-and-quality] - **Past searches** lists earlier runs so you can reopen their results. - The **Quality** popover shows the grade of the current run and the gaps that come up most often across your searches. ## Limits [#limits] Each run has a time and search budget: about three minutes, plus about 90 seconds for each *keep searching*. Results only include information that is published on the public web. Lead search only collects publicly published information, but you are responsible for how you contact people. Follow the marketing and data protection rules that apply in your market, and honor unsubscribe requests. ## Related [#related] Find people at companies you already track. Group new leads for outreach. Reach your new leads. Start lead searches from your own code. --- # Knowledge base (/luso8/knowledge-base) > Upload the documents your AI agents search to answer customers accurately, organized in folders and indexed for semantic search. The knowledge base is the library your AI agents read from when they answer on chat, in support conversations and on the phone. Good knowledge means accurate answers: when a customer asks a question, the agent searches the relevant folders, finds the closest passages and grounds its reply in them. If nothing matches, it says it does not have that information instead of guessing. Find it under **Data → Knowledge**. ## Folders and documents [#folders-and-documents] Knowledge is organized into **folders**, such as *Product*, *Pricing* or *Policies*. Inside a folder you add **documents**. You choose which folders each [AI agent](/luso8/agents) can search, so a sales agent and a support agent can read different material. ## Add documents [#add-documents] 1. Open **Data → Knowledge** and pick a folder, or create a new one. 2. Choose **Add knowledge** and upload one or more files. 3. Wait until the document shows **Ready**. From then on, agents can use it. Supported file types: **PDF**, **DOC**, **DOCX**, **TXT**, **MD**, **CSV** and **XLSX**. ### Processing stages [#processing-stages] Each document goes through these stages before it is searchable: | Stage | What happens | | --- | --- | | **Upload** | The file is received. | | **Validation** | The file type and contents are checked. | | **Metadata** | Title and other details are extracted. | | **Governance** | The document is checked before it is made available to agents. | | **Processing** | Text is extracted and split into passages (chunks). | | **Indexing** | Passages are indexed for semantic search. | | **Ready** | Agents can search the document. | The knowledge page shows how many chunks each document produced and how much storage your workspace uses. ## Test what agents will find [#test-what-agents-will-find] Use the search box on the knowledge page to run a semantic search, the same kind of search your agents run. If the right passage does not come back for a question your customers ask, improve the document or split it up. ## Write knowledge that answers well [#write-knowledge-that-answers-well] - **One topic per document.** Focused documents search better than one large file. - **Use clear headings and plain language.** Agents quote passages, so write the way you want to be quoted. - **Tidy spreadsheets.** Spreadsheets are read row by row, so a table with clear column headers lets an agent find the exact line a caller asks about. - **Keep it current.** When prices or policies change, replace the document so agents do not repeat old information. Agents also use your published help center articles, which visitors can read themselves in the chat widget. See [Web chat widget](/luso8/inbox/web-chat-widget#help-articles). ## Related [#related] Choose which folders each agent can read. Knowledge, agent and widget, end to end. Upload documents and search from your own code. --- # Campaigns (/luso8/campaigns) > Build multi-step, multi-channel outreach sequences with branches and AI-written copy, review every step, then launch and measure results. Campaigns run outreach for you. You design a sequence of steps once, enroll contacts, and Luso8 works each person through the steps: sending messages, waiting, and branching on what they do. Every message is reviewed before launch. Find campaigns under **Engage → Sequencer**. ## Create a campaign [#create-a-campaign] Choose **New campaign** and pick how to start: - **From scratch**: an empty canvas. - **From a template**: ready-made sequences with conditions already wired up. - **Build with AI**: describe your goal and audience, in writing or by voice, and AI drafts the whole sequence for you to edit. Campaign messages can be written in **English**, **Chichewa** or **Swahili**. ## Channels [#channels] A sequence can mix channels. Each message step uses one: | Channel | Notes | | --- | --- | | **Email** | Sent from your own domain when one is set up. See [Email](/luso8/inbox/email). | | **SMS** | Text messages to the contact's phone. | | **WhatsApp** | Sent from your connected WhatsApp number. See [WhatsApp](/luso8/inbox/whatsapp). | | **Phone (manual)** | Creates a call task for a teammate in the dialer. | | **AI call** | A [voice agent](/luso8/agents/voice-agents) calls the contact. | | **LinkedIn** | Through the HeyReach integration in **Settings → Channels → Integrations**. | | **Facebook** | Messages through your connected Page. | Channels that are switched off in your workspace's inbox settings are hidden and blocked in campaigns. ## Steps [#steps] Build the sequence on the canvas by adding steps and connecting them. Connections can go in any direction. | Step | What it does | | --- | --- | | **Message** | Sends a message you write on the chosen channel. | | **AI message** | Writes a personalized message for each contact. | | **Wait** | Pauses for a set time, from one hour to one week. | | **Condition** | Splits the sequence into **Yes** and **No** branches. | | **Webhook** | Calls a URL in your own system. See [Webhooks](/developers/webhooks). | | **Update contact** | Changes a field on the contact. | | **Add to list** / **Remove from list** | Changes the contact's [list](/luso8/crm/lists) membership. | | **End** | Ends the sequence for the contact. | A step that sits on a branch is only reached through that branch. ### Conditions [#conditions] Conditions branch on what the contact did, or on their data: - Email opened, clicked or replied - SMS replied - Call answered or completed - Meeting booked - Link clicked - Form submitted - Contact replied (any channel) - Time elapsed - A contact attribute - A custom event A condition branch can also start a [workflow](/luso8/workflows), for example to create a deal when someone books a meeting. ## Review before launch [#review-before-launch] Every message step must be reviewed before a campaign can launch. Each step shows a badge: | Badge | Meaning | | --- | --- | | **Needs copy / review** | The step has no copy yet, or it has not been reviewed. | | **AI draft - review** | AI wrote this copy. Read it before launch. | | **Edited - re-review** | The copy changed after it was reviewed. | | **Reviewed** | Ready to send. | To speed things up, you can have AI draft every message step at once, then mark every step that has copy as reviewed. Signatures apply to email steps only, with a switch on each step. ## Enroll contacts and launch [#enroll-contacts-and-launch] 1. Open the campaign's **Contacts** tab and add contacts, usually from one or more [lists](/luso8/crm/lists). 2. Check the **Settings** tab. 3. Choose **Launch**. ## Statuses [#statuses] | Status | Meaning | | --- | --- | | **Draft** | Being built. Nothing is sent. | | **Scheduled** | Will start at the scheduled time. | | **Active** | Running. Contacts move through the steps. | | **Paused** | Stopped for now. Choose **Resume** to continue. | | **Completed** | Every contact has finished the sequence. | | **Archived** | Kept for history. | Relaunching a campaign archives the previous run so results stay separate. A campaign that has sent messages cannot be deleted; archive it instead. ## Measure results [#measure-results] Each campaign has five tabs: **Workflow** (the canvas), **Contacts** (filter by replied or not replied), **Meetings** (meetings booked from the campaign), **Settings** and **Analytics**. **Analytics** shows: - Delivery, open, click, reply and conversion rates. - A funnel from **Sent** to **Delivered**, **Opened**, **Clicked**, **Replied** and **Converted**. - Bounced and unsubscribed counts. - How far each contact has progressed. - Performance for each step, so you can see which message works. Replies land in the [inbox](/luso8/inbox), where your team can pick up the conversation. ## Related [#related] A step-by-step walkthrough. Choose who to enroll. Work the replies. Automate what happens after a branch. --- # Inbox (/luso8/inbox) > Work every customer conversation across email, chat, WhatsApp, Messenger, Instagram, SMS and calls from one shared inbox. The inbox brings every conversation into one place. Email replies, website chats, WhatsApp, Messenger and Instagram messages, SMS and phone calls all land in the same queue, with the contact's details beside each thread. Your team works from one view instead of jumping between tools, and a reply on one channel is visible to everyone. Open it from **Engage → Inbox**. ## Layout [#layout] The inbox has three panes: 1. **Folders and channels** on the left. 2. **Conversations** in the middle. 3. **The thread** on the right, with the contact's details, linked deals and actions. The sidebar folds itself away on the inbox to give the thread more room. ### Folders [#folders] | Folder | What it shows | | --- | --- | | **Inbox** | Open conversations that need attention. | | **Drafts** | Replies you started but have not sent, including AI drafts. | | **Sent** | Messages your team has sent. | | **AI Responses** | Replies drafted by AI, waiting for review. | | **Starred** | Conversations you starred. | | **Assigned to me** | Conversations assigned to you. | | **All, incl. closed** | Everything, including resolved and archived conversations. | ### Channels [#channels] Filter by channel: **Email**, **Chat**, **SMS**, **LinkedIn**, **WhatsApp**, **Messenger**, **Instagram**, **Calls**, **AI Calls** and **Meetings**. A separate view lists WhatsApp calls. ## Connect channels [#connect-channels] | Channel | Set up in | | --- | --- | | Website chat | [Web chat widget](/luso8/inbox/web-chat-widget) | | WhatsApp | [WhatsApp](/luso8/inbox/whatsapp) | | Messenger and Instagram | [Messenger and Instagram](/luso8/inbox/messenger-instagram) | | Email | [Email](/luso8/inbox/email) | | LinkedIn | HeyReach integration in **Settings → Channels → Integrations** | | Phone calls | [Call center](/luso8/call-center) | Admins can switch channels on or off for the whole workspace in **Settings → Channels → Integrations**, on the **Engage Inbox** card. Disabled channels are hidden in the inbox and blocked in campaigns. ## Work a conversation [#work-a-conversation] Open a conversation to see the full thread and the contact on the side. From the thread you can: - **Reply** on the same channel, with attachments. - **Assign** the conversation to a teammate and set its priority. - **Star** it, or change its status. - **Call** the contact from the thread header, or **Call back** after a missed call. - **Create a deal**, link the conversation to an existing deal, attach products and send a payment link. See [Deals and pipeline](/luso8/crm/deals). - **Book a meeting.** Meetings booked from a conversation are listed under **Meetings** and can be edited there. ### Statuses and priority [#statuses-and-priority] | Status | Meaning | | --- | --- | | **Open** | Needs attention. | | **Pending** | Waiting on the customer or a teammate. | | **Snoozed** | Hidden until later. | | **Resolved** | Done. | | **Archived** | Kept for history. | Priority is **Low**, **Normal**, **High** or **Urgent**. ## Calls in the thread [#calls-in-the-thread] A phone or WhatsApp call shows up as a single live card in the conversation. The card changes as the call goes from ringing to connected to ended or missed, and afterwards holds the **recording**, the **transcript** and an **AI summary**. - On WhatsApp calls, you can put a caller on hold with music and swap between two calls. - For live AI calls, you can listen in and choose **Take over** to talk to the caller yourself. ## Voice notes [#voice-notes] You can record and send voice notes. On WhatsApp they arrive as real voice messages with a waveform, just like a voice note sent from the phone. ## AI in the inbox [#ai-in-the-inbox] In the inbox, AI **drafts** replies; it never sends on its own. Drafts appear in **AI Responses** and **Drafts** for a teammate to review, edit and send. Admins turn AI-drafted replies on or off on the **Engage Inbox** card in **Settings → Channels → Integrations**. AI agents that answer customers by themselves work in **Support → Conversations**, where a teammate can take over at any time. See [Handoff to humans](/luso8/agents/handoff). You see when a customer is typing on website chat. WhatsApp, Messenger and Instagram do not share typing status with businesses, so for those channels the thread shows **Seen** when the customer has read your message. ## Related [#related] Let agents answer support conversations. Campaign replies land in the inbox. Track issues raised in conversations. Review calls after they end. --- # Web chat widget (/luso8/inbox/web-chat-widget) > Add a branded chat widget to your website, connect an AI agent to answer visitors, and hand conversations to your team. The web chat widget puts a chat window on your own website. Visitors can ask questions any time and get answers from an [AI agent](/luso8/agents) grounded in your knowledge, read your help articles, and reach your team when they need a person. Conversations appear in **Support → Conversations**. Set it up under **Support → Embed bot**. ## Create a widget [#create-a-widget] 1. Open **Support → Embed bot** and choose **New widget**. 2. Work through the configuration tabs below. The preview updates as you go. 3. Copy the embed code and add it to your site. You can create several widgets, for example one per website or brand. ## Configure the widget [#configure-the-widget] - **Name** of the widget (for your team). - **Size** of the chat window. - **Colors** to match your brand. - **Position** on the page. - **Corner radius**. - **Company name** and **logo**. - **Headline** shown at the top of the chat. - **Welcome message** and **initial messages** visitors see when they open the chat. - **Placeholder** text in the message box. - **Connected AI agent**: the agent that answers visitors. - **Display name** and **avatar** for the agent. - **Branding** and an **Active** switch to turn the widget on or off. - **Voice notes and spoken replies**: visitors can send voice notes, and the agent can reply with audio. - **Show transcripts to visitors**: show the text of voice messages. - **File attachments**: let visitors send files. Choose which help center articles appear in the widget's **Help** tab, so visitors can find answers themselves. **Allowed domains**: the widget only loads on the domains you list and their subdomains. Leave the list empty to allow any site. Always set **Allowed domains** for a live widget. Otherwise anyone can copy your embed code onto another site. ## Add it to your website [#add-it-to-your-website] The embed code is a single script tag. Add it once, before the closing `` tag, on every page where the chat should appear. Replace `YOUR_WIDGET_ID` with the ID shown in the embed dialog; the dialog gives you the exact code for your widget. ```html title="index.html" ``` ```tsx title="app/layout.tsx" import Script from 'next/script'; export default function RootLayout({ children }: { children: React.ReactNode }) { return ( {children} ``` ## Help articles [#help-articles] Articles and FAQs you publish in **Support → Help center** can be shown in the widget's **Help** tab. Organize them in collections, keep drafts until they are ready, and use **Try search** to test what visitors will find. The help center shows views and how often an article was marked helpful. Agents use published articles too. ## What visitors can and cannot do [#what-visitors-can-and-cannot-do] - Visitors can chat, send voice notes and files (when enabled), and read help articles. - The widget does not support live two-way voice calls. - Text inside images that visitors send is not read by the agent. ## When a person is needed [#when-a-person-is-needed] The connected agent answers on its own until a teammate steps in. It hands the conversation to your team when the visitor asks for a person or when it cannot help, and a teammate can take over at any time. See [Handoff to humans](/luso8/agents/handoff). ## Related [#related] The full setup, step by step. Create and tune the agent behind the widget. Give the agent accurate answers. --- # WhatsApp (/luso8/inbox/whatsapp) > Connect a WhatsApp Business number to send and receive messages, voice notes and calls in Luso8, and choose where its conversations land. Connect your WhatsApp Business number to talk to customers on the app they already use. Messages, voice notes and WhatsApp calls show up in Luso8, AI agents can answer support conversations, and campaigns can send WhatsApp steps. ## Before you begin [#before-you-begin] - You need to be a workspace **Owner** or **Administrator**. - You need a Facebook account with access to your business in Meta Business Manager, or the permission to create one during setup. - Have the phone number ready. It must be able to receive a verification code by SMS or voice call. A number already used in the regular WhatsApp app has to be moved to WhatsApp Business first. ## Connect a number [#connect-a-number] ### Start the signup [#start-the-signup] Open **Settings → Channels → WhatsApp** and choose **Connect**. A window from Meta opens. ### Complete Meta's setup [#complete-metas-setup] Sign in with Facebook, pick or create your business, create or choose your WhatsApp Business account, add your phone number and verify it with the code Meta sends. ### Check the connection [#check-the-connection] When the window closes, the number appears in your list of connected accounts, one row per number. Send a test message to it from your phone; it should appear in Luso8 within a few seconds. You can connect several numbers, for example one for sales and one for support. ## Choose where messages land [#choose-where-messages-land] Open **Routing & calling** on a connected number to decide where its conversations go. | Incoming messages go to | Behavior | | --- | --- | | **Auto** | Support, unless the contact is in an active campaign or has an open deal, in which case the sales inbox. | | **Always Support** | A dedicated support line. Conversations go to **Support → Conversations**, where AI agents can answer. | | **Always Inbox** | The sales inbox, **Engage → Inbox**. | A support conversation can be moved to the sales inbox at any time with **Move to Inbox**. The support thread closes and the conversation continues in the Engage inbox. ## WhatsApp calls [#whatsapp-calls] WhatsApp numbers can also take and make voice calls. In **Routing & calling**: - **Surfaces** decides where the number rings: the **Engage Inbox** (calls from the conversation header), the **Dialer**, and the **Call Center** (incoming-call banner and ringtone). With no surface selected, the number does not ring. - **Pick-up agents** are the members who can answer inbound calls. - **AI agent** writes the short text messages sent before and after a call. It never joins the call audio. In a conversation, each call appears as a live card with its recording, transcript and AI summary afterwards. During WhatsApp calls you can place a caller on hold with music and swap between calls. See [Inbox](/luso8/inbox#calls-in-the-thread). ## Messaging rules [#messaging-rules] WhatsApp has rules for businesses that Luso8 follows for you: - **Voice notes** you record in Luso8 arrive as real WhatsApp voice messages. - **Typing status** is not shared with businesses; the thread shows **Seen** when the customer has read your message. - **Campaigns** can include WhatsApp steps that send from your connected number. See [Campaigns](/luso8/campaigns). WhatsApp limits when a business can freely message someone who has not written recently, and may require approved message templates outside that window. Plan campaign WhatsApp steps with these rules in mind. ## Disconnect a number [#disconnect-a-number] Open the number in **Settings → Channels → WhatsApp** and choose **Disconnect**, then confirm. Luso8 stops receiving and sending messages for that number. ## Related [#related] Work WhatsApp conversations with the rest of your channels. How AI support conversations reach your team. Ring WhatsApp calls in the call center. --- # Messenger and Instagram (/luso8/inbox/messenger-instagram) > Connect your Facebook Page and Instagram professional account to answer Messenger and Instagram Direct messages from Luso8. Connect a Facebook Page to receive and reply to Messenger conversations, and an Instagram professional account to handle Instagram Direct messages. Both work the same way in Luso8 and can be routed to the sales inbox or to support, where an AI agent can answer. Set them up under **Settings → Channels**, on the **Facebook Messenger** and **Instagram** sections. ## Before you begin [#before-you-begin] - You need to be a workspace **Owner** or **Administrator**. - You need admin access to the Facebook Page in Meta. - For Instagram, the account must be a **professional** account (Business or Creator) that is linked to a Facebook Page, with **Allow access to messages** turned on in the Instagram app (under message settings). ## Connect an account [#connect-an-account] 1. Open the **Facebook Messenger** or **Instagram** section and choose **Connect with Facebook**. 2. Sign in with Facebook and grant the permissions Luso8 asks for. 3. Pick the Page (and its linked Instagram account) you want to connect. The account appears under **Connected accounts**. If you manage your own Meta app, choose **Connect manually** and paste a Page access token. The section also shows the webhook values to enter in your Meta app dashboard so messages reach Luso8. Page tokens are stored encrypted for your workspace and are never sent to the browser. ## Route conversations [#route-conversations] Each connected account has routing options: - **Where messages land**: the sales inbox (**Engage → Inbox**) or support (**Support → Conversations**). - **Support AI agent**: the [AI agent](/luso8/agents) that answers support conversations from this account. From a support conversation you can choose **Move to Inbox** to close the support thread and continue in the Engage inbox. ## Messaging rules [#messaging-rules] Meta has rules for business messaging that apply to both channels: Replies must go out within 24 hours of the person's last message. After that, replies are sent with Meta's *Human Agent* tag, which allows a person on your team to reply for up to 7 days. - **Typing status** is not shared by Meta for these channels. The thread shows **Seen** when the person has read your message. - Messenger and Instagram conversations sit alongside every other channel in the [inbox](/luso8/inbox), with the contact's details beside them. ## Related [#related] Work every channel in one place. Connect WhatsApp Business. How AI support conversations reach your team. --- # Email (/luso8/inbox/email) > Send campaign and inbox email from your own domain, verify it with DNS records, and route replies back into the Luso8 inbox. Luso8 can send email from your own domain, such as `outreach@mail.acme.com`, so messages carry your brand and land in inboxes instead of spam folders. Replies to those messages can come straight back into the Luso8 [inbox](/luso8/inbox). Set it up under **Settings → Channels → Email**. You need to be a workspace **Owner** or **Administrator**, and you need access to your domain's DNS settings. ## Which address Luso8 sends from [#which-address-luso8-sends-from] For each message, Luso8 uses the first of these that is available: 1. **Your own address**, when a teammate's mailbox is set up on a verified domain. 2. **Your organization's default domain**. 3. **The Luso8 platform address**, so email still works before you set up a domain. Set up your own domain before you send campaigns. Mail from your own domain is more trusted by mailbox providers. ## Connect a domain [#connect-a-domain] ### Add the domain [#add-the-domain] In **Organization domains**, choose **Connect domain** and fill in the form: | Field | Example | Notes | | --- | --- | --- | | **Domain** | `mail.acme.com` | Use a subdomain you control, so your main domain's mail is not affected. Required. | | **From email** | `outreach@mail.acme.com` | The default sender address. Required. | | **From name** | `Acme Sales` | The name recipients see. | | **Reply-to** | `replies@mail.acme.com` | Where replies are addressed. | | **Region** | | Where your email is processed. | Tick **Default once verified** to make this the organization's default domain as soon as it is verified. The form also accepts a **Resend API key** if you want sends billed to your own Resend account. With your own key, you can also add its **Webhook signing secret** now or later so replies can be received. Leave both empty to use Luso8's sending. ### Add the DNS records [#add-the-dns-records] Open **Show DNS records** on the new domain. Luso8 lists the records your domain needs, usually: | Record | Purpose | | --- | --- | | **DKIM** (TXT) | Signs your messages so providers can confirm they came from you. | | **SPF** (TXT) | Lists the servers allowed to send for the domain. | | **Return-Path** (MX / CNAME) | Handles bounces for the domain. | Copy each host and value with the copy buttons and add them at your DNS provider. ### Verify [#verify] Choose **Verify DNS**. DNS changes can take from a few minutes to a few hours to spread. If verification fails, wait and try again, and double-check that the host names were not doubled up by your DNS provider (for example `mail.acme.com.acme.com`). ### Make it the default [#make-it-the-default] Choose **Make default** on a verified domain to send from it by default. ## Receive replies in the inbox [#receive-replies-in-the-inbox] The **Receiving replies** panel lists what is needed so replies to your domain come back into Luso8: 1. **Reply-to**: the address replies are sent to, on your domain. 2. **MX record**: add it to your domain's DNS so mail for that address is accepted. Give it the lowest priority. 3. **Webhook**: if you use your own sending account, copy the webhook URL into it and paste the signing secret into Luso8. Once this is set up, replies to your campaigns and inbox emails appear as conversations in the [inbox](/luso8/inbox), threaded with the original message. ## Disconnect a domain [#disconnect-a-domain] Choose **Disconnect** on the domain. Luso8 falls back to the next sender in the order above. ## Deliverability tips [#deliverability-tips] - **Warm up new domains.** Start with small sends and grow over a few weeks. - **Keep lists clean.** Bounced and unsubscribed contacts are skipped automatically; remove contacts that never engage. - **Write like a person.** Review AI-written copy before launch. Campaigns require it. See [Campaigns](/luso8/campaigns#review-before-launch). - **Add a DMARC record** for your domain at your DNS provider to further improve trust. ## Related [#related] Send email sequences from your domain. Work email replies with every other channel. Other channel settings. --- # AI agents (/luso8/agents) > Create AI agents that talk to your customers in chat, campaigns and calls, grounded in your knowledge and limited to the actions you allow. An AI agent is an assistant that works for your team. It answers questions from your [knowledge base](/luso8/knowledge-base), qualifies leads, books meetings, opens tickets and takes other actions in Luso8. Each agent only does what you switch on. Anything that would create, change, send, schedule or charge waits for a person to approve it first. You manage agents in **Engage → Agents**. The page has two tabs: - **Agents**: the agents themselves, with their instructions, knowledge, skills and tool access. - **Voice agents**: the phone personas of your agents. See [Voice agents](/luso8/agents/voice-agents). ## Agent kinds [#agent-kinds] When you create an agent you choose one of two kinds. | Kind | What it's for | Where it appears | | --- | --- | --- | | **Agent** | Talks to customers and prospects | Support conversations, the chat widget, inbox drafts, campaign AI steps and AI calls | | **Sales coach** | Plays a prospect in practice calls and grades your reps | Only in **AI tools → Sales coach**. It never shows up in customer-facing pickers | You can also tag an agent with a **type** to keep the list organized: Campaign, Research, Voice support, Chat support, Sales or Custom. The type is used for filtering; it doesn't limit what the agent can do. ## Create an agent [#create-an-agent] ### Start from scratch or a template [#start-from-scratch-or-a-template] Open **Engage → Agents** and choose **New agent**. Templates fill in sensible instructions for common jobs, such as support or lead qualification, which you can edit. ### Describe the job [#describe-the-job] On the **General** tab, give the agent a name and a short description, then write its **Instructions** and **Task & goals**. Write them like a brief for a new teammate: who it talks to, what it should achieve, its tone, and what it must never do. ### Ground it in your knowledge [#ground-it-in-your-knowledge] On the **Knowledge** tab, pick the knowledge base folders the agent can search. It cites what it finds there instead of guessing. Keep folders focused, for example one for product FAQs and one for pricing. ### Choose what it can do [#choose-what-it-can-do] On the **Behavior** tab, turn on the [Luso8 access](#luso8-access) the agent needs, add [skills](#skills) and connect any [integrations](#integrations). Everything is off by default. ### Test and activate [#test-and-activate] Chat with the agent from its page to check its answers, then set it to **Active** and connect it where it should work: a [chat widget](/luso8/inbox/web-chat-widget), a messaging channel, a campaign step or a [voice agent](/luso8/agents/voice-agents). ## The agent editor [#the-agent-editor] | Tab | What you set | | --- | --- | | **General** | Basic information, instructions, task and goals | | **Behavior** | Luso8 access switches, skills, integrations, AI model | | **Voice** | The agent's voice persona for phone calls (see [Voice agents](/luso8/agents/voice-agents)) | | **Knowledge** | Knowledge base folders the agent searches | The editor also shows **Statistics** for the agent: conversations handled and how they ended. ## Luso8 access [#luso8-access] Luso8 access switches decide which parts of your workspace the agent can read and act on. There are 13 switches in three groups. They are all off for a new agent, and a change applies from the agent's next message or call. | Group | Switch | What it allows | | --- | --- | --- | | Meetings and customer service | **Book meetings** | Check availability and book, move or cancel appointments | | | **Handle tickets** | Open, update and comment on tickets, and close a ticket once the customer confirms the fix | | | **Read the inbox** | Read conversation history for context | | | **Send messages** | Send messages to contacts on connected channels | | | **Calls** | Look up call logs and schedule calls | | Customers and sales | **Contacts** | Search, create and update contacts | | | **Companies** | Search, create and update companies | | | **Deals and leads** | Search and update deals, leads and prospects | | | **Lists** | Read lists and add or remove contacts | | Campaigns, knowledge and reporting | **Campaigns** | Read campaigns and add contacts to them | | | **Knowledge base** | Search knowledge base folders and help center articles | | | **Workflows** | List and run [workflows](/luso8/workflows) | | | **Reports** | Read workspace metrics and reports | Give an agent the fewest switches it needs for its job. A website support agent usually needs only Knowledge base, Handle tickets and Book meetings. ## Actions need confirmation [#actions-need-confirmation] Agents can read freely within their switches, but any action that **creates, changes, sends, schedules or charges** is shown to a person for an explicit yes before it runs: - In chat, the agent shows what it is about to do and waits for approval. - On a voice call, the agent reads the action back and waits for the caller to confirm. This applies to every agent, including the [platform assistant](/luso8/assistant). ## Skills [#skills] Skills are reusable playbooks you attach to agents, managed in **AI tools → Skills**. A skill bundles instructions, steps, tool rules, quality checks, examples and knowledge for one kind of task, for example researching a company before a call or writing a follow-up email. Start from a template, import a skill, or write your own, then attach it on the agent's **Behavior** tab. One skill can be shared by many agents, so improving it improves all of them. ## Integrations [#integrations] Agents can also work with tools outside Luso8. Connect them from the agent's **Behavior** tab: | Integration | Typical use | | --- | --- | | Email (SMTP) and Gmail | Send email from your own mailbox | | Google Calendar and Calendly | Check availability and book meetings | | HubSpot and Salesforce | Look up and update records in your other CRM | | Notion | Read internal pages | | Odoo | Look up orders and customers | | Collect payments | Send a payment link during a conversation | Integrations follow the same rule as Luso8 access: anything that changes data or sends something needs approval first. ## Where agents work [#where-agents-work] ## Related [#related] How agents pass conversations and calls to your team. A step-by-step guide. --- # Voice agents (/luso8/agents/voice-agents) > Give an agent a voice so it can answer inbound calls, place outbound calls and run sales practice calls. A voice agent is the phone persona of one of your [AI agents](/luso8/agents). It takes inbound calls and makes outbound calls, answers from your knowledge base, looks up the caller, books meetings and sends payment links, all with the same rules as the agent it belongs to. ## How voice agents relate to agents [#how-voice-agents-relate-to-agents] A voice agent doesn't have its own copy of the agent's brain. It always uses its **parent agent's** current instructions, knowledge folders, Luso8 access, skills and integrations. When you improve the parent agent, the voice agent picks up the change on its next call. What the voice agent adds on top: | Setting | What it does | | --- | --- | | **Voice and language** | The voice the caller hears and the language it speaks | | **Voice tuning** | Sliders for Stability, Similarity boost, Style and Speed | | **Voice-specific instructions** | Only what differs on the phone, for example "keep answers under two sentences" or "spell out email addresses" | | **Phone number** | The number it answers on and calls from | Keep voice-specific instructions short. Everything the agent should know in every channel belongs in the parent agent's instructions, not here. ## Create a voice agent [#create-a-voice-agent] ### Open the Voice agents tab [#open-the-voice-agents-tab] Go to **Engage → Agents → Voice agents** and choose **Create voice agent**. You can also open an agent and create its phone persona from its **Voice** tab. ### Pick the parent agent [#pick-the-parent-agent] Choose the agent whose instructions, knowledge and tools the voice agent should use. ### Choose and test the voice [#choose-and-test-the-voice] Pick a voice and language, adjust the sliders, then type a sample line in **Test this voice** and play it. Nothing is saved until you choose to save, so try a few settings. ### Assign a phone number [#assign-a-phone-number] Select one of your workspace's numbers. Numbers are added by an admin in **Settings → Workspace → Telephony**. See [number pools](/luso8/call-center#phone-numbers-and-number-pools) for which numbers can be used where. ### Turn it on [#turn-it-on] Save and switch the voice agent on. You can pause it at any time with its toggle. ## Inbound calls [#inbound-calls] When someone calls a number assigned to a voice agent, the agent greets them and helps right away. It can identify the caller from your CRM, answer questions from the knowledge base, book a meeting, open a ticket or send a payment link, depending on the parent agent's access. If your workspace uses the [call center](/luso8/call-center), inbound calls can ring your human agents first and reach the voice agent when nobody picks up. See [Handoff to humans](/luso8/agents/handoff#calls). ## Outbound calls [#outbound-calls] Voice agents place outbound calls from two places: - **The dialer.** In **Engage → Dialer**, switch the call mode to AI and pick a voice agent. It works through your dial queue and follows the call objective you set. See [Dialer](/luso8/call-center/dialer). - **Campaigns.** Add an **AI call** step to a [campaign](/luso8/campaigns). The voice agent calls each contact when they reach that step, and the outcome can branch the sequence. Every AI call is logged with its recording, transcript and an AI summary. See [Recordings and transcripts](/luso8/call-center/recordings). ## Listen in and take over [#listen-in-and-take-over] While an AI call is live you can listen in from the inbox thread or the call center, and take over at any moment. The voice agent steps back and you continue the conversation. See [Handoff to humans](/luso8/agents/handoff). ## Practice calls with the sales coach [#practice-calls-with-the-sales-coach] A **Sales coach** agent uses a voice too, but only for practice. It plays a prospect, follows its playbooks, and grades the call when you hang up. 1. Open **AI tools → Sales coach** and pick a coach. 2. If it has no voice yet, open the coach's **Voice** tab and choose **Activate**. 3. In the **Simulator**, choose **Training** to practice at your own pace, or **Compete** to have the call scored for the team leaderboard. You can also set how the prospect behaves. 4. Review past calls and feedback in **History**, and team rankings in **Leaderboard**. Sales coaches never answer real customers: they are hidden from every customer-facing agent picker. ## Tips for natural calls [#tips-for-natural-calls] - Write instructions for the ear: short sentences, one question at a time. - Tell the agent what to do when it can't help, for example "offer to book a call with the team". - Test with a colleague calling in before you put a number in front of customers. --- # Handoff to humans (/luso8/agents/handoff) > How AI agents pass conversations and calls to your team, and how your team takes over or hands back. AI agents handle the routine, and your team handles everything else. Luso8 is built so that a customer is never stuck with an agent that can't help: the agent hands off on its own, your team is notified, and anyone can take over at any time. ## Where agents act on their own [#where-agents-act-on-their-own] | Place | What the AI does | | --- | --- | | **Support conversations** (chat widget, WhatsApp, Messenger, Instagram, email) | Replies to customers on its own until it hands off or a teammate steps in | | **Engage inbox** | Only **drafts** replies. A person reviews and sends every message | | **Calls** (voice agents) | Talks to the caller on its own; your team can listen in and take over | ## Chat and messaging [#chat-and-messaging] ```mermaid flowchart LR A["Customer writes"] --> B{"AI on for this conversation?"} B -- Yes --> C["Agent replies from knowledge and tools"] C --> D{"Can it help?"} D -- Yes --> E["Conversation continues"] D -- "No / customer asks for a person" --> F["Needs a human"] F --> G["AI pauses, reason saved as internal note"] G --> H["Team is notified"] H --> I["Teammate replies"] B -- No --> I ``` ### The AI switch [#the-ai-switch] Every support conversation has an **AI on/off** switch in its header. While it's on, the assigned agent replies to the customer. It turns off by itself when: - a teammate sends a reply in the conversation, - the conversation is handed off to a human, or - the conversation is resolved. Turn it back on when you want the agent to pick up again, for example after you've answered the one question it couldn't. ### "Needs a human" [#needs-a-human] An agent hands off when the customer asks for a person, when the topic is outside its instructions or knowledge, or when it can't complete a turn. It doesn't go silent. When it hands off: 1. The AI is paused for that conversation. 2. The reason is saved as an **internal note**, visible only to your team. 3. Your team is notified, and the conversation shows as needing a human. Customers never see technical errors: if the agent can't answer, the conversation goes to your team instead. You can also hand off manually: assign the conversation to a teammate, or transfer it to another teammate with a note. Participants can be the **owner**, a **collaborator** or an **observer**. ### Move to the inbox [#move-to-the-inbox] For WhatsApp, Messenger and Instagram, **Move to Inbox** closes the support thread and continues the conversation in the [Engage inbox](/luso8/inbox), where sales follow-ups, deals and products live. Use it when a support chat turns into a sales opportunity. ## Calls [#calls] ### Listen in and take over [#listen-in-and-take-over] When a voice agent is on a live call, the call appears as a live card in the inbox thread and in the [call center](/luso8/call-center) dashboard. From either place you can: - **Listen in**: hear the call silently. The caller doesn't hear you. - **Take over**: the voice agent steps back and you talk to the caller directly. ### When the agent asks for a person [#when-the-agent-asks-for-a-person] A voice agent can request a handoff during a call, for example when the caller asks for a person. Available teammates get a notification that rings in their browser. The first to accept joins the call and the agent steps back. If nobody accepts in time, the agent carries on with the caller. ### Human first, AI as backup [#human-first-ai-as-backup] In the call center, inbound calls ring your human agents first. If a queue has AI fallback turned on (it is off by default) and nobody answers, an AI agent takes the call so the customer isn't left waiting. It works the other way too: a human agent can hand a live call to an AI agent, for example to collect details or take a payment, and continue with the next caller. ```mermaid flowchart LR Call["Inbound call"] --> Queue["Queue"] Queue --> Human{"Human agent answers?"} Human -- Yes --> Talk["Human handles the call"] Human -- No --> AI["AI agent takes the call"] Talk -. "hand to AI" .-> AI AI -. "request handoff" .-> Human ``` ## After the handoff [#after-the-handoff] Everything the agent did stays on the record: the full conversation or transcript, the internal note with the handoff reason, and any tickets, meetings or deal updates it made. Your teammate has the full context when they pick up. ## Related [#related] Instructions, knowledge, access and confirmation rules. Queues, agents and live monitoring. Every channel in one place. Track issues that need follow-up. --- # Platform assistant (/luso8/assistant) > Ask questions and get work done across Luso8 in plain language, with your approval before anything changes. The platform assistant is Luso8's built-in co-pilot. It knows your workspace: your contacts, lists, deals, campaigns, inbox, tickets, bookings, calls and reports. Ask it a question and it answers with real numbers and links; ask it to do something and it prepares the change for you to approve. ## Open the assistant [#open-the-assistant] - **Home.** Click the Luso8 logo. Home is the assistant, full screen, labelled **Assistant**. - **Anywhere else.** Click the sparkle button in the corner of any page. The assistant opens beside your work and knows which page you're on, so "summarize this deal" or "who are these contacts?" just works. ## What you can ask [#what-you-can-ask] - "Show me open deals over 10,000 in negotiation." - "Which contacts from Acme replied to last week's campaign?" - "Find tickets about billing that are still open." - "What's on my calendar tomorrow?" - "How did our campaigns perform this month compared with last month?" - "Summarize yesterday's calls and their outcomes." - "What's in my pipeline and where are deals getting stuck?" - "Give me this week's support stats." - "Create a list of everyone who booked a meeting this month." - "Add these five contacts to the Q1 outreach campaign." - "Open a ticket for this customer's delivery issue and assign it to me." - "Book a 30-minute call with Jane next Tuesday afternoon." - "Build a workflow that creates a ticket when a call ends badly." Answers include links to the records and pages they mention, so you can jump straight to a contact, deal or report. ## You approve every change [#you-approve-every-change] The assistant reads freely, but it never changes anything without your explicit yes. When a request would create, update, send, schedule or charge, the assistant shows exactly what it will do, for example the ticket it will open or the message it will send, and waits. - **Approve** to run it as shown. - **Reject** to cancel. Nothing is changed. You can then tell the assistant what to adjust and it prepares a new version. The assistant acts as you. It can only see and change what your [role](/luso8/settings/roles) allows in the current workspace. ## What it can work with [#what-it-can-work-with] | Area | Examples | | --- | --- | | CRM | Search and update contacts and companies, manage lists, review deals, leads and prospects | | Campaigns | Review campaigns and analytics, add contacts, draft follow-ups | | Inbox | Summarize conversations, draft and send messages, escalate to a teammate | | Calls | Call logs and performance, schedule calls | | Appointments | Find and book meetings, update their status | | Tickets | Open, update, comment on and close tickets | | Workflows | List, run and create workflows from examples or a description | | Knowledge | Search your knowledge base and help center | | Reports | Dashboard stats, report overviews, recent activity | | Navigation | "Take me to the dialer", "where do I connect WhatsApp?" | ## Tips [#tips] - **Be specific.** Names, dates and amounts get you better answers than "recent" or "big". - **Chain requests.** "Find contacts in Kenya with no deal, then add them to a new list called Kenya follow-up." - **Ask how.** The assistant also knows the product: "how do I set up email on my own domain?" ## Related [#related] Build customer-facing agents with the same confirmation rules. Use Luso8 from Claude, ChatGPT or Cursor. --- # Call center (/luso8/call-center) > Run inbound and outbound phone support with human and AI agents, queues, live monitoring and reporting. The call center is where your team handles phone calls together: inbound calls land in queues, are routed to available human or AI agents, and are monitored live by supervisors. Every call is recorded, transcribed and summarized, so nothing is lost after hang-up. Open it from **Support → Call center**. It appears for people who have been added as call-center agents and for workspace admins (owners, administrators and managers). For outbound prospecting from lists and queues, use the [Dialer](/luso8/call-center/dialer). The call center focuses on support and team-wide phone operations. ## Set up the call center [#set-up-the-call-center] ### Connect a telephony provider [#connect-a-telephony-provider] Luso8 works with your own phone provider. An admin connects **Twilio**, **Telnyx** or an **Asterisk** PBX in **Settings → Workspace → Telephony → Providers**. ### Add phone numbers [#add-phone-numbers] In **Settings → Workspace → Telephony → Phone numbers & trunks**, add the numbers you want to use and choose whether each one belongs to the **Call Center**, the **Dialer**, or both. See [number pools](#phone-numbers-and-number-pools). ### Add agents [#add-agents] On the **Agents** tab, add teammates as human agents and add AI agents (your [voice agents](/luso8/agents/voice-agents)) to answer when humans can't. ### Create queues [#create-queues] On the **Queues** tab, create a queue for each line of work, for example Sales, Support or Billing. Assign agents and pick a routing strategy. ### Set service levels and hours [#set-service-levels-and-hours] On the **Settings** tab, set your SLA targets and business hours, and choose which AI features run on calls. ## Tabs [#tabs] | Tab | What it's for | Who sees it | | --- | --- | --- | | **Dashboard** | Live wallboard: agent statuses, calls in queue, handle time, SLA and abandoned calls | Everyone with access | | **Agents** | Human and AI agents, their status and queues | Admins | | **Queues** | Queues, routing strategy and assigned agents | Everyone with access | | **Call History** | Past calls with recording, transcript and AI summary | Everyone with access | | **Reports** | Daily operations, agent scorecards, queue performance | Admins | | **Quality** | Call quality evaluations | Admins | | **Settings** | SLA, business hours, phone numbers, providers and AI features | Admins | ## Queues and routing [#queues-and-routing] Each queue decides which agent gets the next call. Choose a routing strategy per queue: | Strategy | How the next agent is chosen | | --- | --- | | **Round robin** | Agents take turns in order | | **Longest idle** | The agent who has been free the longest | | **Skills-based** | The agent whose skills best match the queue | | **Priority** | Agents with a higher priority are offered calls first | | **Random** | Any available agent | Inbound calls ring your human agents first. A queue can optionally fall back to an AI agent, so that when nobody is available the AI answers instead of leaving the caller waiting. AI fallback is off unless an admin turns it on for the queue. See [Handoff to humans](/luso8/agents/handoff#calls). ## Agent statuses [#agent-statuses] Human agents log in to take calls and set their status from the call center. Supervisors see every agent's status live on the dashboard. | Status | Meaning | | --- | --- | | **Offline** | Logged out; receives no calls | | **Idle** | Logged in and available | | **Ringing** | A call is being offered | | **On call** | Talking to a caller | | **On hold** | The current caller is on hold | | **Wrap-up** | Finishing notes and disposition after a call | | **Break** | Temporarily unavailable | | **Manual on** | Available for manually assigned calls | ## Live monitoring [#live-monitoring] The dashboard lists every active call with the caller, direction, whether a human or AI is handling it, status and live duration. From a call you can: - **Listen in**: hear the call silently. - **Jump in**: take over from an AI agent; the AI steps back. - **Request pickup**: ask an available teammate to take the call. - **End call**: end or cancel the call. ## Phone numbers and number pools [#phone-numbers-and-number-pools] Each number in your workspace belongs to a pool: | Pool | Used for | | --- | --- | | **Call Center** | Inbound queues and call-center outbound calls | | **Dialer** | Outbound calls from the [Dialer](/luso8/call-center/dialer) and campaigns | | **Both** | Shared between the two | Outbound calls only use caller IDs from the matching pool, so your support line never shows up on a cold call, and prospects call back the right team. ## Service levels and business hours [#service-levels-and-business-hours] On the **Settings** tab, admins configure: - **SLA**: the answer-time threshold and the percentage of calls you aim to answer within it. The dashboard and reports measure against these targets. - **Business hours**: opening hours per day and your time zone. - **AI features**: transcription, sentiment and quality scoring on calls, and call recording. ## Reports [#reports] The **Reports** tab has three views: | Report | What it shows | | --- | --- | | **Daily Ops** | Call volume, answer and abandon rates, SLA and handle time for the day | | **Agent Scorecard** | Per-agent calls, handle time and outcomes | | **Queue Performance** | Per-queue volume, wait times and SLA | ## Related [#related] Outbound calls from lists and queues. Review and coach from past calls. AI agents that answer the phone. Invite teammates and make them call-center agents. --- # Dialer (/luso8/call-center/dialer) > Make outbound calls yourself or with an AI voice agent, work through dial queues and log every outcome. The dialer is built for outbound calling. Call a contact from your browser, or let an AI [voice agent](/luso8/agents/voice-agents) work through a queue for you. Every call is recorded, transcribed and summarized, with a suggested outcome you confirm in one click. Open it from **Engage → Dialer**. You can also call a contact directly from an inbox thread with **Call** or **Call back**. ## Views [#views] | View | What it's for | | --- | --- | | **Dial** | Place calls: pick contacts, use the keypad, choose human or AI mode | | **Queues** | Saved dial queues and the campaign call queue | | **Call logs** | Every call with recording, transcript, summary and disposition | | **Performance** | Call volume and outcomes for you and your team over time | | **Scheduled** | Calls booked for later by you, a teammate, a campaign or an agent | ## Choose a call mode [#choose-a-call-mode] Switch between **Human** and **AI** at the top of the dialer. The call connects to your browser and you talk. Use a headset for the best quality. While you talk, the call is transcribed with two speakers, you and the contact, so your notes write themselves. Pick a voice agent and set the call objective. The agent places the call, follows its instructions and logs the outcome. You can listen in to any AI call and take over at any moment. Turn on **Skip Voicemails** to have the agent hang up when it reaches voicemail or an answering machine instead of leaving a message. Outbound calls use caller IDs from your workspace's **Dialer** number pool. See [number pools](/luso8/call-center#phone-numbers-and-number-pools). ## Who to call [#who-to-call] You can dial in three ways: - **From a list.** Pick one of your [lists](/luso8/crm/lists) and call through it. - **From a dial queue.** Add people to a queue, review who's in it, remove anyone you don't want to call, then **Start dialing** to work through it one by one. Queues are saved, so they survive a refresh and your team can see them. - **Manually.** Type a number on the keypad. The **campaign call queue** shows calls scheduled by [campaigns](/luso8/campaigns) with phone or AI call steps, so reps can see what's due. ## Calls in progress [#calls-in-progress] Active calls appear in the **Calls in progress** panel. From there you can monitor a call, listen in, jump in to take over from an AI agent, or end it. ## After the call [#after-the-call] When a call ends, Luso8 writes an **AI summary** and suggests a **disposition** and comments. The rep accepts them or edits before saving, so call logs stay consistent without slowing anyone down. | Disposition | Use it when | | --- | --- | | **Booked** | A meeting was booked | | **Positive** | Good conversation, interested | | **Callback** | The contact asked to be called back | | **Not Interested** | The contact declined | | **Has Solution** | They already use something else | | **Not ICP** | Not a fit for your ideal customer profile | | **Gatekeeper** | You reached a gatekeeper, not the decision-maker | | **Left Org** | The person no longer works there | | **Wrong Number** | The number is wrong | | **DNC** | The contact asked not to be called again | | **Voicemail** | You reached voicemail | | **Answering Machine** | An answering machine picked up | | **Dial Tree** | You reached a phone menu | | **No Voice** | The call connected but nobody spoke | | **Hangup** | The contact hung up | Dispositions feed the **Performance** view and [reports](/luso8/reports), and they're available to [workflows](/luso8/workflows) through the "call ended" trigger. Mark contacts who ask not to be called as **DNC** right away, and check the rules for outbound calling in the countries you call. ## Scheduled calls [#scheduled-calls] Schedule a call for later from the dialer, a contact or an inbox thread. Scheduled calls appear in the **Scheduled** view, where you can edit, reschedule or cancel them. Campaigns and agents with the **Calls** access switch can schedule calls too. ## Related [#related] Find and review past calls. Inbound queues and live monitoring. Add phone and AI call steps to sequences. --- # Recordings and transcripts (/luso8/call-center/recordings) > Every call keeps its recording, transcript and AI summary, so you can review, coach and follow up. Luso8 records and transcribes calls automatically, then writes a short AI summary. Whether a call was handled by a person or an AI agent, inbound or outbound, you can find it later with everything that was said. ## What's saved with a call [#whats-saved-with-a-call] | Item | Details | | --- | --- | | **Recording** | The audio of the call, playable in the browser | | **Transcript** | The conversation as text, split by speaker. Human calls show you and the contact as two speakers | | **AI summary** | A few lines on what happened and what was agreed | | **Disposition** | The outcome, suggested by AI and confirmed by the rep (see [dispositions](/luso8/call-center/dialer#after-the-call)) | | **Details** | Direction, number, agent (human or AI), duration and time | ## Where to find them [#where-to-find-them] In the [inbox](/luso8/inbox), each call appears as one card in the contact's thread: ringing, connected or missed while it happens, then the recording, transcript and summary once it ends. This keeps calls next to the emails and messages with the same person. WhatsApp calls show up the same way. In **Support → Call center → Call History**, browse and filter every call that went through your queues, then open a call to play the recording and read the transcript. In **Engage → Dialer → Call logs**, find outbound calls made from the dialer and campaigns, with their dispositions and comments. ## Use them [#use-them] - **Coach.** Listen back with a rep, or use the call center's **Quality** tab to evaluate calls. For practice, see the [sales coach](/luso8/agents/voice-agents#practice-calls-with-the-sales-coach). - **Follow up.** The summary and transcript give you what you need to write a follow-up or update a deal without replaying the call. - **Automate.** Start a [workflow](/luso8/workflows) when a call ends, for example to open a ticket after a complaint or send a recap email. - **Ask.** The [platform assistant](/luso8/assistant) can summarize calls for you: "What came out of yesterday's calls with Acme?" ## Access and privacy [#access-and-privacy] - Recordings and transcripts are kept with the call log in your workspace and are visible only to members of that workspace. - Recordings play through short-lived links generated when you open them, so a copied link stops working after a short time. - Admins choose in **Support → Call center → Settings** whether calls are recorded and which AI features (transcription, sentiment, quality scoring) run on them. Many countries require you to tell people a call is recorded. Add a short notice to your greeting or your voice agent's instructions, and follow the rules where your customers are. ## Related [#related] Queues, agents and settings. Outbound calls and dispositions. How Luso8 protects your data. --- # Appointments and bookings (/luso8/appointments) > Manage meetings on your team's calendars and let customers book time through public booking pages. Luso8 keeps every meeting with a customer in one place, whether your team booked it, a customer booked it on a booking page, or an AI agent booked it in a conversation. Meetings sync with your calendar and link back to the contact, conversation or deal they came from. Both pages live under **Pipeline** in the sidebar: - **Pipeline → Appointments**: every meeting, in a list or calendar. - **Pipeline → Scheduling**: booking pages and the bookings they produce. ## Connect your calendar [#connect-your-calendar] Connect **Google Calendar** or **Outlook Calendar** from the Appointments page. Once connected, new meetings are added to your calendar, and availability for booking pages and AI agents comes from it, so nobody gets double-booked. If you connect more than one calendar, set one as your default. ## Appointments [#appointments] Create an appointment with **New Appointment**, or let it be created for you from a booking page, an inbox conversation, a campaign or an AI agent. ### Types [#types] | Type | Use it for | | --- | --- | | **1:1** | A meeting with one person | | **Group** | Several attendees at once | | **Team** | Several hosts from your team | | **Webinar** | A larger session | | **Phone Call** | A scheduled call | | **In Person** | A meeting at a physical location | ### Location [#location] Choose **Google Meet**, **Zoom**, **Microsoft Teams**, **Phone** or a **Custom link**. For video meetings, the link is added to the invitation. ### Recurrence [#recurrence] Repeat a meeting **daily**, **weekly**, **biweekly** or **monthly**, or leave it as a one-off. ### Statuses [#statuses] | Status | Meaning | | --- | --- | | **Scheduled** | Booked, not yet confirmed | | **Confirmed** | The attendee confirmed | | **Rescheduled** | Moved to a new time | | **Completed** | The meeting happened | | **No Show** | The attendee didn't attend | | **Cancelled** | Called off | Update the status after each meeting. Completed and no-show meetings feed your [reports](/luso8/reports), and the "appointment booked" event can start a [workflow](/luso8/workflows). ## Booking pages [#booking-pages] Booking pages let customers pick a time themselves. Create them in **Pipeline → Scheduling**. ### Create an event type [#create-an-event-type] Choose **New Event Type**, name it (for example "Product demo") and set the duration, from 15 minutes to 2 hours. ### Set the location [#set-the-location] Pick **Video** (Google Meet), **In person**, **Phone** or **Custom**. ### Choose who hosts [#choose-who-hosts] | Host assignment | How it works | | --- | --- | | **Only me** | Every booking goes to you | | **Round robin** | Bookings rotate across the hosts you pick | | **Collective** | All selected hosts attend; only times when everyone is free are offered | ### Ask questions and send reminders [#ask-questions-and-send-reminders] Add custom intake questions to collect what you need before the call, and set reminders from 15 minutes to 2 days before the meeting. ### Share the link [#share-the-link] Copy the public booking link or open it to check it. Put it in your email signature, on your website, or in a [campaign](/luso8/campaigns) step. Bookings made on the page appear under the event type and in Appointments. You can view and cancel them from either place. ## Meetings from conversations [#meetings-from-conversations] - **Inbox.** Meetings booked from a conversation appear under the **Meetings** channel in the [inbox](/luso8/inbox) and can be edited there. - **AI agents.** Agents with the **Book meetings** switch check availability and book, move or cancel meetings, always after the customer confirms. See [AI agents](/luso8/agents#luso8-access). - **Campaigns.** A "meeting booked" condition can branch a sequence, and booked meetings show on the campaign's **Meetings** tab. ## Related [#related] Let an agent book meetings for you. Drive bookings from sequences. --- # Tickets (/luso8/tickets) > Track customer issues raised from the inbox and the CRM until they're resolved. A ticket is a customer issue that needs follow-up beyond a single reply: a bug, a billing question, a delivery problem. Tickets keep the issue, its owner, its due date and its history in one place, linked to the contact and the conversation it came from. Open them from **Support → Tickets**. ## Create a ticket [#create-a-ticket] You can open a ticket from several places: - **The tickets page.** Choose **New ticket**. - **A conversation.** In a support conversation or an inbox thread, use **Create ticket**, or attach an existing ticket with **Attach an existing ticket**. - **An AI agent.** Agents with the **Handle tickets** switch can open tickets during a conversation, after the customer confirms. See [AI agents](/luso8/agents#luso8-access). - **The platform assistant.** "Open a ticket for this customer's delivery issue." - **A workflow.** Use an agent step whose agent has **Handle tickets**, for example to open a ticket when a call ends with a complaint. See [Workflows](/luso8/workflows). ### Fields [#fields] | Field | Notes | | --- | --- | | **Title** | A short summary of the issue | | **Description** | What happened, what the customer expects, anything already tried | | **Category** | Free text such as Billing, Bug or Question; reuse categories to filter and report | | **Priority** | Low, Normal, High or Urgent | | **Assignee** | The teammate responsible, or Unassigned | | **Due date** | When it should be resolved; overdue tickets are flagged | | **Contact** | The customer the ticket is about | Each ticket also gets a number, so you can find it by `#number` in search. ## Statuses [#statuses] | Status | Meaning | | --- | --- | | **Open** | New, not yet picked up | | **In progress** | Someone is working on it | | **Pending** | Waiting on the customer or a third party | | **Resolved** | Fixed; add how it was resolved | | **Closed** | Done and confirmed | ## Work a ticket [#work-a-ticket] Open a ticket to see its details in a side panel. From there you can change the status, priority and assignee, add context for whoever picks it up next, and post **comments** to discuss it with your team. When you resolve a ticket, note how it was resolved so the next person facing the same issue can find the answer. AI agents with **Handle tickets** can close a ticket once the customer confirms the problem is fixed. ## Find tickets [#find-tickets] Filter by status, priority and assignee, or search by title, description, category or ticket number. Tickets linked to a contact also appear on the contact's **Tickets** tab, and tickets linked to a conversation appear beside it in the inbox. ## Report on tickets [#report-on-tickets] The **Tickets** tab in [Reports](/luso8/reports) shows volume and resolution over time, compared with the previous period. ## Related [#related] Where most tickets start. How agents escalate to your team. Create tickets automatically. --- # Workflows (/luso8/workflows) > Automate work across Luso8 with event, schedule and webhook triggers, AI agent steps, conditions and human review. Workflows automate the work that happens between your tools and your team. A workflow starts from a **trigger**, such as a call ending, a deal being won, a schedule or a webhook, then runs a chain of **steps**: ask an AI agent, call an external service, wait, branch on a condition, notify someone or pause for a person to approve. Build them in **AI tools → Workflows**. ## Create a workflow [#create-a-workflow] Choose **New Workflow** and pick how to start: | Option | When to use it | | --- | --- | | **Describe it** | Write what you want in plain language ("when a deal is won, email the customer a welcome and create an onboarding ticket") and AI builds the first version | | **Examples** | Start from one of the ready-made examples and adjust it | | **Blank** | Build step by step on an empty canvas | The workflow opens in the **Builder**: a canvas with the trigger at the top and steps below it. ## Triggers [#triggers] | Trigger | Fires when | | --- | --- | | **Event** | Something happens in Luso8 (see the events below) | | **Schedule** | On a cron schedule in your time zone, for example every weekday at 08:00 | | **Webhook** | An external system sends a POST request to the workflow's secret URL | | **Manual / API** | You click **Run**, an AI agent runs it, or it's triggered through the API | ### Events [#events] | Event | Fires when | | --- | --- | | `call.ended` | A call finishes | | `payment.received` | A payment link is paid | | `deal.created` | A deal is created | | `deal.stage_changed` | A deal moves to another stage | | `deal.won` | A deal is closed won | | `deal.lost` | A deal is closed lost | | `contact.created` | A contact is added | | `message.received` | A customer message arrives in the inbox | | `appointment.booked` | A meeting is booked | | `campaign.completed` | A campaign finishes | | `connector.synced` | A data connection finishes syncing | Each event comes with a sample payload in the builder so you can see which fields you can use. A [campaign](/luso8/campaigns) condition branch can also start a workflow. ### Filters [#filters] Narrow an event trigger with filters on payload fields. Use dotted keys for nested fields; a list means "any of": ```json title="Only deals reaching proposal or closed won in Malawi" { "stage": ["proposal", "closed_won"], "contact.country": "MW" } ``` ### Webhook trigger [#webhook-trigger] A webhook trigger gives the workflow a secret URL. Send a JSON body to it and the body becomes the workflow's input: ```bash curl -X POST "https://api.luso8.rexplore.ai/api/v1/ai-workflows/hooks//" \ -H "Content-Type: application/json" \ -d '{"email": "jane@example.com", "plan": "pro"}' ``` Treat the URL like a password: anyone who has it can start the workflow. Only share it with systems you trust. See [Webhooks](/developers/webhooks) for more on sending and receiving webhooks. ## Steps [#steps] | Step | What it does | | --- | --- | | **Agent** | Sends a message to one of your [AI agents](/luso8/agents) and uses its reply. The agent can act within its Luso8 access | | **Skill** | Runs a skill from **AI tools → Skills** | | **Connector** | Runs a sync on one of your data connections | | **Condition** | Branches on an expression, for example a deal value or a call disposition | | **Wait** | Pauses for a duration or until a time | | **Webhook** | Calls an external URL with data from the run | | **Code** | Runs a short, sandboxed Python snippet to compute a value | | **Transform** | Reshapes data for the next step | | **Notification** | Notifies teammates in Luso8, by email or by SMS | | **Human review** | Pauses until an assigned teammate approves or rejects | | **Sub-workflow** | Runs another workflow | | **End** | Stops the run | ## Use data from earlier steps [#use-data-from-earlier-steps] Any text field in a step can include expressions in double curly braces, such as `{{ trigger.contact.email }}`. These names are available: | Name | Contains | | --- | --- | | `trigger` | The event payload or webhook body that started the run | | `input` | The step's input: its mapped input, else the previous step's output | | `prev` | The previous step's output | | `steps` | Outputs of earlier steps, by each step's output key, e.g. `steps.summary` | | `vars` | Workflow variables | | `review` | The last human review result: `approved` and `comment` | | `run`, `workflow` | IDs and the workflow name | Expressions support comparisons, `and`/`or`/`not`, arithmetic, conditionals and safe helpers such as `len`, `round`, `sorted`, `get`, `json` and `now`. A missing field never breaks a run: it's empty, so `{{ input.contact.email or "n/a" }}` falls back cleanly. A field that contains only one expression keeps its type (number, list or object). Anything mixed with text becomes a string. ## Compile, activate and run [#compile-activate-and-run] ### Compile [#compile] **Compile** checks the whole workflow before anything runs: the trigger, every step's required fields, the agents, skills and connections it references, expression syntax, loops and unreachable steps. The builder shows **Compiles** when it's ready, or marks the steps that need attention. After an edit it shows **Changed since compile**. ### Test run [#test-run] Run the workflow once with sample input to check each step's output before going live. ### Activate [#activate] Set the workflow to **Active**. Only active workflows receive triggers. ## Runs [#runs] The **Runs** tab lists every run with its trigger and status. Open a run to see each step's input, output and any error, which makes it easy to see where something went wrong. Runs waiting on a **Wait** or **Human review** step resume on their own when the time comes or the reviewer answers, and you can cancel a run at any time. ## Examples [#examples] - **Call follow-up.** On `call.ended` with a negative outcome, ask a support agent to open a ticket and notify the account owner. - **Won deal onboarding.** On `deal.won`, send a welcome email, book a kickoff call and notify the team. - **Daily digest.** Every weekday at 08:00, ask an agent to summarize yesterday's pipeline changes and email it to sales. - **Form to CRM.** A webhook from your website form creates the contact and adds it to a nurture campaign. ## Related [#related] The agents your workflows call. Trigger workflows from your systems. Trigger and inspect workflows over the API. --- # Reports (/luso8/reports) > See how engagement, campaigns, AI agents, calls, tickets and sales are performing, compared with the previous period. Reports give you one view of how your workspace is doing, from conversations and campaigns to calls, tickets and revenue. Every feature report compares the selected period with the one before it, so you can see what changed at a glance. Open them from **Content → Reports**. ## Overview [#overview] The **Overview** tab shows all-time totals across the workspace, with two views: - **Features**: a card per area (engagement, campaigns, visitors, AI agents, calls, tickets, content and sales) with its headline numbers. - **Activity**: what happened recently, for the last day, 7 days or 30 days. ## Feature reports [#feature-reports] Each area has its own tab. Pick a period and every number is compared with the previous period of the same length. | Tab | What it covers | | --- | --- | | **Engagement** | Conversations and messages across inbox channels | | **Campaigns** | Sends, deliveries, opens, clicks, replies and conversions | | **Visitors** | Website visitors and their activity from the tracking script | | **AI agents** | Conversations handled by agents and how they ended | | **Calls** | Call volume, outcomes and talk time across the dialer and call center | | **Tickets** | Tickets opened and resolved | | **Content** | Articles published and their reach | | **Sales** | Deals, pipeline value and won revenue | ## Snapshots and export [#snapshots-and-export] Save a **snapshot** of a report to keep the numbers as they were at that moment, for example at the end of a month or quarter. Saved snapshots can be reopened and exported to share with people outside Luso8. ## More detailed reports [#more-detailed-reports] Some features have their own, deeper reporting: ## Ask the assistant [#ask-the-assistant] You don't have to find the right tab. Ask the [platform assistant](/luso8/assistant) questions like "How did this month's campaigns compare with last month?" or "Give me this week's support stats", and it answers from the same data with links to the details. ## Reports over the API [#reports-over-the-api] Workspace metrics and report exports are also available through the [Luso8 API](/developers/api-reference) with the `reports:read` scope, so you can pull them into your own dashboards. --- # Guides (/luso8/guides) > Step-by-step walkthroughs for common Luso8 Cloud jobs, from your first campaign to an AI agent on your website. Guides walk through a complete job from start to finish, across the features involved. Each one takes 15 to 30 minutes. ## Luso8 Cloud [#luso8-cloud] ## For developers [#for-developers] ## Setup checklists [#setup-checklists] If you are setting up a new workspace, these pages cover the essentials: Create your workspace and invite your team. DNS records and receiving replies. Messages, voice notes and calls. Numbers, queues and agents. --- # Launch your first campaign (/luso8/guides/first-campaign) > Build a list, design a multi-step email and WhatsApp sequence with a reply branch, review the copy, launch it and read the results. In this guide you build a three-touch outreach campaign: an email, a follow-up for people who did not reply, and a WhatsApp nudge. You review every message, launch, and then measure what worked. **You will need:** a workspace with some contacts, and ideally your own email domain set up (see [Email](/luso8/inbox/email)). WhatsApp is optional. ## What you will build [#what-you-will-build] ```mermaid flowchart TD A["Email: introduction"] --> B["Wait 3 days"] B --> C{"Replied?"} C -- Yes --> D["Add to list: Hot leads"] --> E["End"] C -- No --> F["AI message: follow-up email"] F --> G["Wait 2 days"] G --> H["WhatsApp: short nudge"] --> I["End"] ``` ### Build your audience list [#build-your-audience-list] 1. Open **Data → Contacts** and filter to the people you want to reach, for example by country. 2. Select them and choose **Add to list**, then create a new list called *Q1 outreach*. 3. Create a second, empty list called *Hot leads*. The campaign will move people who reply into it. Unsubscribed and bounced contacts are skipped automatically. See [Lists](/luso8/crm/lists). ### Create the campaign [#create-the-campaign] Open **Engage → Sequencer** and choose **New campaign**. Start **from scratch** so you can follow along, and name it *Q1 outreach*. Next time, try **Build with AI**: describe your offer and audience and AI drafts the whole sequence for you to edit. ### Add the steps [#add-the-steps] On the canvas, add and connect these steps: 1. **Message**, channel **Email**: your introduction. Write a short subject and a few lines about the problem you solve. Use personalization variables such as the contact's first name and company. 2. **Wait**: 3 days. 3. **Condition**: *Email replied*. This creates **Yes** and **No** branches. 4. On **Yes**: **Add to list** *Hot leads*, then **End**. 5. On **No**: **AI message**, channel **Email**: a short follow-up. AI writes a personalized version for each contact. 6. **Wait**: 2 days. 7. **Message**, channel **WhatsApp**: a one-line nudge. Skip this step if WhatsApp is not connected. 8. **End**. ### Review every message [#review-every-message] Every message step must be reviewed before launch. Open each step and read it: - **AI draft - review** means AI wrote it. Check facts, tone and names. - **Edited - re-review** means it changed after a review. - When a step looks right, mark it **Reviewed**. Turn the signature on for the email steps if you want your email signature added. See [Review before launch](/luso8/campaigns#review-before-launch). ### Enroll contacts [#enroll-contacts] Open the **Contacts** tab and add the *Q1 outreach* list. Check the **Settings** tab for the campaign language and other options. ### Launch [#launch] Choose **Launch**. The campaign becomes **Active**, and each contact starts at the first step. You can **Pause** at any time and **Resume** later. ### Work the replies [#work-the-replies] Replies arrive in **Engage → Inbox**, threaded with the original email. People who replied by email are added to *Hot leads* automatically. Open a conversation to reply, book a meeting or create a deal. See [Inbox](/luso8/inbox). ### Read the results [#read-the-results] Open the **Analytics** tab: - The **funnel** shows how many contacts went from sent to delivered, opened, clicked, replied and converted. - **Per-step performance** shows which message worked best. Compare the introduction with the AI follow-up. - **Bounced** and **unsubscribed** counts tell you how healthy your list is. The **Meetings** tab lists meetings booked from the campaign. ## Next steps [#next-steps] - Start a [workflow](/luso8/workflows) from the **Yes** branch, for example to create a deal and notify the owner. - Add an **AI call** step so a [voice agent](/luso8/agents/voice-agents) calls people who opened but did not reply. - Find more people like your best responders with [lead search](/luso8/lead-search). --- # Put an AI agent on your website (/luso8/guides/website-ai-agent) > Create an AI agent, give it your knowledge, embed the chat widget on your site and make sure conversations reach your team when a person is needed. In this guide you put an AI assistant on your website that answers visitors from your own documents and hands the conversation to your team when it should. **You will need:** an Owner or Administrator role, a few documents that answer common customer questions (pricing, product, policies), and access to your website's HTML or CMS. ### Add your knowledge [#add-your-knowledge] 1. Open **Data → Knowledge** and create a folder called *Website assistant*. 2. Upload the documents visitors ask about: product overview, pricing, delivery and returns, opening hours. PDF, Word, text, Markdown, CSV and Excel files all work. 3. Wait until each document shows **Ready**. 4. Use the search box to ask a few real customer questions and check the right passages come back. Focused documents answer best: one topic per file. See [Knowledge base](/luso8/knowledge-base). ### Create the agent [#create-the-agent] 1. Open **Engage → Agents** and create a new agent. 2. On **General**, give it a name visitors will see, such as *Ama from Acme*, and choose the **Chat support** type. 3. On **Behavior**, write its instructions: who it works for, the tone to use, what it should and should not answer, and when to hand over to a person. For example: *"You help visitors to Acme's website. Answer only from the knowledge provided. If someone asks about an order or wants to speak to someone, hand the conversation to the team."* 4. On **Knowledge**, select the *Website assistant* folder. 5. Leave the Luso8 access switches off for now. Turn on **Book meetings** or **Handle tickets** later if you want the agent to do those jobs; it always asks the visitor to confirm before acting. See [AI agents](/luso8/agents) for every option. ### Create the chat widget [#create-the-chat-widget] 1. Open **Support → Embed bot** and create a widget. 2. **Appearance**: set your brand colors and the position on the page. 3. **Content**: add your logo, a headline and a welcome message, such as *"Hi! Ask me anything about Acme."* 4. **Agent**: pick the agent you just created and make sure the widget is **Active**. 5. **Security**: add your website's domain under **Allowed domains**, so the widget only loads on your site. ### Test it [#test-it] Use the preview to ask the questions your customers ask most. If an answer is wrong or missing, improve the documents or the instructions, not the question. ### Embed it on your site [#embed-it-on-your-site] Copy the embed code and add it before the closing `` tag on every page: ```html title="index.html" ``` The embed dialog has ready-made versions for HTML, React, JavaScript and WordPress. See [Web chat widget](/luso8/inbox/web-chat-widget#add-it-to-your-website). ### Make sure your team sees handoffs [#make-sure-your-team-sees-handoffs] Conversations from the widget appear in **Support → Conversations**. When the agent hands over, because the visitor asked for a person or it could not help, it pauses itself, saves the reason as an internal note and notifies your team. - A teammate replies in the conversation; the AI switch turns off automatically so the agent does not talk over them. - Turn the AI back on when you are done, or leave it off and resolve the conversation. See [Handoff to humans](/luso8/agents/handoff). ## Next steps [#next-steps] - Publish help articles in **Support → Help center** and show them in the widget's **Help** tab. - Turn on **Voice notes and spoken replies** in the widget's **Agent** tab so visitors can talk instead of type. - Give the agent a phone line with a [voice agent](/luso8/agents/voice-agents). - Track how the agent performs in [Reports](/luso8/reports). --- # Settings overview (/luso8/settings) > Where to find every setting in Luso8, from your profile to your workspace, channels and developer tools. Settings is one page with three tabs. Each tab is split into sections, shown as pills along the top. Open it from the user menu in the sidebar (your name or avatar), then choose **Settings**. Every section has its own link, so you can bookmark it or send it to a teammate. Some sections are only visible to workspace owners and administrators; see [Roles](/luso8/settings/roles). ## Account [#account] Settings that belong to you, in every workspace you're a member of. | Section | What you manage | | --- | --- | | **Profile** | Your name, photo, email signature and a link to your Rexplore ID security settings. See [Profile and notifications](/luso8/settings/profile) | | **Notifications** | Which notifications you get in the app, by email and on your devices, quiet hours and sounds | ## Workspace [#workspace] Settings for the current workspace, shared by everyone in it. | Section | What you manage | Who sees it | | --- | --- | --- | | **Company** | Workspace name, logo and company profile (description, mission, products and services). Your AI agents use this profile for context | Everyone | | **Members** | Invite teammates, change roles, revoke invitations. See [Team](/luso8/settings/team) | Owners and admins | | **Billing** | Your plan and payments | Everyone | | **Telephony** | Phone providers, phone numbers and number pools for the [call center](/luso8/call-center) and [dialer](/luso8/call-center/dialer) | Owners and admins | ## Channels [#channels] How Luso8 talks to your customers. | Section | What you manage | Guide | | --- | --- | --- | | **Email** | Send and receive inbox email on your own domain | [Email](/luso8/inbox/email) | | **WhatsApp** | Connect WhatsApp Business numbers and route their messages | [WhatsApp](/luso8/inbox/whatsapp) | | **Facebook Messenger** | Connect a Facebook Page | [Messenger and Instagram](/luso8/inbox/messenger-instagram) | | **Instagram** | Connect an Instagram professional account | [Messenger and Instagram](/luso8/inbox/messenger-instagram) | | **Payments** | The default provider for payment links on deals and in conversations | [Deals](/luso8/crm/deals) | | **Integrations** | LinkedIn (via HeyReach) and inbox options: which channels are on, AI-drafted replies, products and deals in the composer | [Inbox](/luso8/inbox) | ## Developers [#developers] > **Preview:** Developer settings are rolling out. Workspace admins will find API keys under **Settings → Developers → API keys**. See [API keys](/developers/api-keys). ## Other places with settings [#other-places-with-settings] Some settings live next to the feature they configure: - **Custom contact fields**: on the Contacts page, under **Manage custom fields**. See [Contacts](/luso8/crm/contacts). - **Call center** SLA, business hours and AI features: **Support → Call center → Settings**. - **Chat widgets**: **Support → Embed bot**. See [Web chat widget](/luso8/inbox/web-chat-widget). - **Website tracking**: **Data → Visitors → Setup**. - **Password, two-step verification and sessions**: your [Rexplore ID account](/rexplore-id/account). ## Related [#related] Your personal settings. Invite and manage members. What each role can do. How your data is protected. --- # Profile and notifications (/luso8/settings/profile) > Set how you appear to teammates and customers, and choose how and when Luso8 notifies you. Your profile and notification settings are personal: they follow you across every workspace you belong to. Find them in **Settings → Account**. ## Profile [#profile] **Settings → Account → Profile** controls how you appear to teammates and in email. | Setting | Notes | | --- | --- | | **Name** | Your first and last name, shown to teammates and as the sender name on your emails | | **Profile image** | PNG, JPEG, GIF or WebP, up to 5 MB. Shown in the sidebar, on assignments and in conversations | | **Email** | The email address of your Rexplore ID account | | **Email signature** | Added to emails you send from the inbox. Supports text styles, links, lists, images and simple tables. The preview shows how recipients see it | Campaign email steps have their own signature switch per step. See [Campaigns](/luso8/campaigns). ## Security [#security] You sign in to Luso8 with your [Rexplore ID](/rexplore-id), the account you use for every Rexplore product. Your password, two-step verification and active sessions are managed there, not in Luso8. The **Security** panel in your profile links straight to it with **Manage Rexplore ID account**. ## Leave a workspace [#leave-a-workspace] There's no self-service leave yet. To leave a workspace, ask an owner or administrator to remove you in **Settings → Workspace → Members**. You keep your Rexplore ID account and your membership of any other workspaces. ## Notifications [#notifications] **Settings → Account → Notifications** controls how and when you're notified, for example when a conversation is assigned to you, an AI agent hands off, a ticket is due or a call rings. ### Channels [#channels] | Channel | Where it reaches you | | --- | --- | | **In-app** | The bell in Luso8 | | **Email** | Sent to your inbox | | **Push** | On your devices, including the Luso8 mobile app | ### Quiet hours [#quiet-hours] Turn on **Quiet hours** and set a start and end time to silence notifications overnight. ### Sounds [#sounds] Turn on **Notification sound** to play a sound when a new notification arrives. Incoming call-center calls and handoff requests ring in your browser. Keep Luso8 open in a tab and allow notifications in your browser while you're on shift. ## Related [#related] Every section at a glance. How Rexplore ID sign-in works. --- # Team (/luso8/settings/team) > Invite teammates to your workspace, manage pending invitations, change roles and remove members. Everyone who works in a Luso8 workspace is a **member** with a [role](/luso8/settings/roles). Owners and administrators manage the team in **Settings → Workspace → Members**. ## Invite a teammate [#invite-a-teammate] ### Open Members [#open-members] Go to **Settings → Workspace → Members**. You need to be an owner or administrator to see this section. ### Enter their email and pick a role [#enter-their-email-and-pick-a-role] Type your teammate's work email and choose a role. New members get **Member** by default. You can add an optional note that's included in the invitation email. The **Owner** role can't be given by invitation. ### Send the invitation [#send-the-invitation] Luso8 emails an invitation link. Your teammate opens it, signs in or creates a [Rexplore ID](/rexplore-id) with that email, and accepts. They land in your workspace with the role you picked. If a teammate didn't accept in time, resend the invitation from the pending list. ## Pending invitations [#pending-invitations] Invitations that haven't been accepted yet are listed under **Pending invitations**. For each one you can: - **Resend** the email, for example if it went to spam or expired. - **Revoke** it, so the link no longer works. ## Change a member's role [#change-a-members-role] In the members list, pick a new role from the member's **Role** menu. The change applies right away. See [Roles](/luso8/settings/roles) for what each role can do. ## Remove a member [#remove-a-member] Remove a member from the members list when they leave your team. They lose access to the workspace immediately. Their Rexplore ID account is not affected, and records they created (contacts, deals, conversations, notes) stay in the workspace. There's no self-service leave yet: members who want to leave ask an owner or administrator to remove them. ## Call-center agents [#call-center-agents] To take calls in the [call center](/luso8/call-center), a member must also be added as a call-center agent on the call center's **Agents** tab. Owners, administrators and managers can see the call center without being agents; other members see it only once they're added. ## Several workspaces [#several-workspaces] One Rexplore ID can belong to several workspaces, for example if you work with more than one company. Each workspace has its own members, roles and data. Switch between them with the workspace switcher; your role can differ from one workspace to the next. ## Related [#related] Owner, Administrator, Manager and Member. Create a workspace and invite your team. --- # Roles (/luso8/settings/roles) > What owners, administrators, managers and members can do in a Luso8 workspace. Every member of a workspace has one role. Roles decide who can manage the team, telephony and other workspace-wide settings. Everyone can use the day-to-day features: CRM, inbox, campaigns, agents, calls and reports. ## The four roles [#the-four-roles] | Role | Summary | | --- | --- | | **Owner** | Full access, including billing and member management. The person who created the workspace is its owner | | **Administrator** | Manages workspace settings and members. Intended to have everything except billing | | **Manager** | Manages team members and sees workspace data. Counts as an admin for the call center and telephony | | **Member** | Uses Luso8 day to day: CRM, inbox, campaigns, agents, calls and reports | ## What each role can do [#what-each-role-can-do] | Capability | Owner | Administrator | Manager | Member | | --- | :---: | :---: | :---: | :---: | | Use CRM, inbox, campaigns, agents, workflows and reports | Yes | Yes | Yes | Yes | | Edit their own profile and notifications | Yes | Yes | Yes | Yes | | Invite and remove members, change roles | Yes | Yes | | | | Manage telephony (providers, numbers, pools) | Yes | Yes | | | | See the call center without being an agent | Yes | Yes | Yes | | | Call center admin tabs (Agents, Reports, Quality, Settings) | Yes | Yes | Yes | | | Manage the plan and billing | Yes | | | | | Create API keys | Yes | Yes | | | The **Owner** role can't be assigned by invitation. Custom roles aren't available yet. Members only see the call center once they've been added as call-center agents. They can then take calls, but the admin tabs stay hidden. See [Team](/luso8/settings/team#call-center-agents). ## API keys [#api-keys] > **Preview:** API keys are rolling out. Workspace owners and administrators create them in **Settings → Developers → API keys**. A key is shown once, belongs to the workspace rather than to a person, and only has the scopes you give it. See [API keys](/developers/api-keys). ## AI agents and the assistant [#ai-agents-and-the-assistant] AI agents don't have a role. Each agent can only use the [Luso8 access](/luso8/agents#luso8-access) you switch on for it, and actions always need a person's approval. The [platform assistant](/luso8/assistant) acts as you, so it can never do more than your own role allows. ## Change a role [#change-a-role] Owners and administrators change roles in **Settings → Workspace → Members**. See [Team](/luso8/settings/team#change-a-members-role). --- # Security and privacy (/luso8/security) > How Luso8 protects your account, your workspace data and your customers' privacy. Luso8 holds your customer relationships: contacts, conversations, calls and deals. This page explains how access is controlled, how data is kept separate between workspaces, and the controls you have to protect your customers' privacy. ## Signing in [#signing-in] You sign in to Luso8 with [Rexplore ID](/rexplore-id), Rexplore's own account service at auth.rexplore.ai. Luso8 never sees your password. - **Strong passwords.** New passwords must be at least 12 characters and are checked against lists of passwords known from breaches. - **Two-step verification.** Add an authenticator app and backup codes so a stolen password alone isn't enough. See [Two-step verification](/rexplore-id/two-step-verification). - **Lockout.** After 5 wrong passwords in 15 minutes, sign-in is locked for 15 minutes and the account owner gets an email. - **Sessions.** See every device signed in to your account and sign out of any of them, or all of them at once, from your [Rexplore ID account](/rexplore-id/account). Resetting your password signs out your other sessions. - **Google sign-in.** You can sign in with Google instead of a password, or connect both. Luso8 uses short-lived access tokens issued by Rexplore ID, so a signed-out or removed user loses access quickly. ## Workspace isolation [#workspace-isolation] Every record in Luso8 belongs to exactly one workspace. Requests are always scoped to the workspace you're working in, whether they come from the app, an AI agent, the platform assistant or an API key. Members of one workspace can't see another workspace's data, and removing a member ends their access immediately. ## Role-based access [#role-based-access] Each member has a [role](/luso8/settings/roles). Workspace-wide settings such as members and telephony are limited to owners and administrators, and call-center admin tools to owners, administrators and managers. ## AI that asks first [#ai-that-asks-first] AI agents and the platform assistant are designed so that a person stays in control: - Each agent can only use the [Luso8 access](/luso8/agents#luso8-access) you switch on for it. All switches are off by default. - Any action that creates, changes, sends, schedules or charges is shown for an explicit yes before it runs, in chat or read back on a call. - The platform assistant acts as you, so it can never exceed your role. - In the inbox, AI only drafts replies; a person sends them. - When an agent can't help, it [hands off](/luso8/agents/handoff) to your team instead of guessing, and customers never see technical errors. ## Data in transit [#data-in-transit] All traffic to Luso8, Rexplore ID and the Luso8 API is encrypted with HTTPS (TLS). Call recordings play through short-lived links generated when you open them. ## API keys [#api-keys] > **Preview:** API keys are rolling out. They are created by workspace owners and administrators, shown only once when created, scoped to the resources you choose (for example `contacts:read`) and limited to one workspace. Revoke a key at any time and it stops working immediately. See [API keys](/developers/api-keys). ## Privacy controls for your customers [#privacy-controls-for-your-customers] | Control | Where | What it does | | --- | --- | --- | | **Anonymize IP** | **Data → Visitors → Setup** | Stores visitor IP addresses in anonymized form | | **Cookie consent required** | **Data → Visitors → Setup** | Tracks visitors only after they accept cookies | | **Respect Do Not Track** | **Data → Visitors → Setup** | Doesn't track browsers that send a Do Not Track signal | | **Allowed domains** | **Support → Embed bot → Security** | Your chat widget loads only on your sites and their subdomains | | **Unsubscribe** | Contacts and campaigns | Unsubscribed contacts are excluded from campaign sends | | **Do not call** | Dialer dispositions | Record DNC requests so the contact isn't called again | | **Call recording** | **Support → Call center → Settings** | Choose whether calls are recorded and which AI features run on them | | **Channel on/off** | **Settings → Channels → Integrations** | Disabled channels are hidden and blocked in campaigns | You decide what data you collect and how you contact people. Make sure you have a lawful basis to store and contact your customers, tell callers when calls are recorded, and honor unsubscribe and do-not-call requests in the countries where you operate. ## Email on your own domain [#email-on-your-own-domain] When you send inbox and campaign email from your own domain, Luso8 gives you DKIM, SPF and Return-Path records to add to your DNS. Verified domains improve deliverability and protect your domain from being spoofed. See [Email](/luso8/inbox/email). ## Report a security issue [#report-a-security-issue] If you believe you've found a security vulnerability in Luso8, Rexplore ID or the Luso8 API, email [hello@rexplore.ai](mailto:hello@rexplore.ai) with the details and steps to reproduce. Please give us a reasonable time to fix the issue before sharing it publicly, and don't access or change data that isn't yours while testing. ## Policies [#policies] - [Luso8 privacy policy](https://luso8.rexplore.ai/privacy-policy) - [Luso8 terms of service](https://luso8.rexplore.ai/terms) --- # Developer overview (/developers) > Build on Luso8 with the REST API, workspace API keys and the remote MCP server. > **Preview:** this feature is in preview. The contract is stable enough to build against, but details may change before general availability. Luso8 gives you programmatic access to the same data and actions your team uses in the app: contacts, companies, deals, campaigns, conversations, calls, appointments, tickets, AI agents, knowledge and workflows. Use it to sync your CRM with your own product, automate outreach from your backend, or let AI assistants such as Claude, ChatGPT and Cursor work inside your workspace. ## What you can build [#what-you-can-build] | Use case | How | | --- | --- | | Keep contacts and companies in sync with your app | [REST API](/developers/api-reference) with `contacts:write` and `companies:write` | | Push won deals, leads and products into your pipeline | REST API with `deals:write` and `leads:write` | | Enroll people in an outreach campaign from your backend | REST API with `campaigns:write` | | Read conversations, call logs and recordings for analytics | REST API with `conversations:read` and `calls:read` | | Start an automation when something happens in your system | [Workflow webhook triggers](/developers/webhooks) | | Ask an AI assistant about your pipeline or let it draft follow-ups | [Remote MCP server](/developers/mcp) | ## Base URL [#base-url] All REST endpoints live under one versioned base URL: ```text https://api.luso8.rexplore.ai/api/v1 ``` Requests and responses use JSON. Every request is scoped to the workspace that owns the API key, so you never pass an organization ID. ## Quick start [#quick-start] ### Create an API key [#create-an-api-key] An Owner or Administrator of your workspace opens **Settings → Developers → API keys**, clicks **Create key**, picks a name and scopes, and copies the key. It is shown only once. See [API keys](/developers/api-keys). ### Make your first request [#make-your-first-request] List the first 10 contacts in your workspace. The key needs the `contacts:read` scope. ```bash tab="cURL" curl "https://api.luso8.rexplore.ai/api/v1/contacts?skip=0&limit=10" \ -H "Authorization: Bearer $LUSO8_API_KEY" ``` ```js tab="JavaScript" const res = await fetch('https://api.luso8.rexplore.ai/api/v1/contacts?skip=0&limit=10', { headers: { Authorization: `Bearer ${process.env.LUSO8_API_KEY}` }, }); if (!res.ok) throw new Error(`Luso8 API error ${res.status}: ${await res.text()}`); const contacts = await res.json(); console.log(contacts.map((c) => c.email)); ``` ```python tab="Python" import os import requests res = requests.get( "https://api.luso8.rexplore.ai/api/v1/contacts", params={"skip": 0, "limit": 10}, headers={"Authorization": f"Bearer {os.environ['LUSO8_API_KEY']}"}, timeout=30, ) res.raise_for_status() for contact in res.json(): print(contact["email"]) ``` A successful call returns `200 OK` with an array of contact objects. ### Explore the reference [#explore-the-reference] Browse every endpoint, its parameters, scopes and response schemas in the [API reference](/developers/api-reference), and try requests in the built-in playground. ## Next steps [#next-steps] ## Resources [#resources] - **OpenAPI schema**: [`https://docs.rexplore.ai/openapi/luso8.json`](https://docs.rexplore.ai/openapi/luso8.json). Import it into Postman, Insomnia or a client generator. - **Docs for AI tools**: [`/llms.txt`](https://docs.rexplore.ai/llms.txt) indexes every page, and [`/llms-full.txt`](https://docs.rexplore.ai/llms-full.txt) contains the full text. Append `.md` to any page URL for its Markdown. - **Support**: email [hello@rexplore.ai](mailto:hello@rexplore.ai) with your workspace name and, for API issues, the request path and time (never the key). --- # Authentication (/developers/authentication) > Authenticate server-to-server with workspace API keys, or act on behalf of a user with Rexplore ID OAuth. > **Preview:** this feature is in preview. The contract is stable enough to build against, but details may change before general availability. The Luso8 API supports two ways to authenticate. Pick the one that matches who is acting. | Method | Acts as | Best for | | --- | --- | --- | | **API key** | Your workspace | Backends, scheduled jobs, integrations you run on a server | | **Rexplore ID OAuth** | A signed-in user | Apps where each person signs in with their own Rexplore ID, and MCP clients | ## API keys [#api-keys] An API key belongs to exactly one workspace and carries a set of [scopes](#scopes). Every request made with the key reads and writes that workspace's data only. Send the key in the `Authorization` header as a bearer token: ```bash curl https://api.luso8.rexplore.ai/api/v1/contacts \ -H "Authorization: Bearer luso8_sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` If your HTTP client or proxy makes the `Authorization` header awkward, send the same key in `X-API-Key` instead: ```bash curl https://api.luso8.rexplore.ai/api/v1/contacts \ -H "X-API-Key: luso8_sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` Create and manage keys in **Settings → Developers → API keys**. See [API keys](/developers/api-keys) for formats, rotation and best practices. An API key grants access to your whole workspace within its scopes. Never put it in a browser bundle, a mobile app, a public repository or a URL. Store it in a secret manager or environment variable and call Luso8 from your backend. ## Rexplore ID OAuth [#rexplore-id-oauth] When your app acts for a specific person, have them sign in with [Rexplore ID](/rexplore-id), the account system behind every Rexplore product. Rexplore ID is a standard OpenID Connect provider: - **Issuer**: `https://auth.rexplore.ai` - **Flow**: authorization code with PKCE (`S256`) - **Tokens**: short-lived RS256 JWT access tokens, rotating refresh tokens with `offline_access` Send the user's access token exactly like an API key: ```bash curl https://api.luso8.rexplore.ai/api/v1/contacts \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIs..." ``` Requests made with a user token run with that user's permissions in their active workspace. The endpoints, discovery document and token lifetimes are documented in [Rexplore ID for developers](/rexplore-id/developers). AI tools that connect to the [remote MCP server](/developers/mcp) use this flow automatically, with dynamic client registration. ## Scopes [#scopes] API keys are limited to the scopes you choose when you create them. Each scope is `:read` or `:write`. | Rule | Meaning | | --- | --- | | `contacts:read` | Read-only access to one resource (`GET` requests) | | `contacts:write` | Create, update and delete on that resource. **Write implies read.** | | `*` | Full access to every resource, now and in the future | The resources are `contacts`, `companies`, `deals`, `leads`, `lists`, `campaigns`, `conversations`, `calls`, `appointments`, `tickets`, `agents`, `knowledge`, `workflows` and `reports`. Each endpoint in the [API reference](/developers/api-reference) states the scope it requires. A request without the needed scope fails with `403`: ```json { "detail": "Missing scope: contacts:write" } ``` ## Authentication errors [#authentication-errors] | Status | Body | Cause | | --- | --- | --- | | `401` | `{"detail": "Invalid API key"}` | Missing, malformed, revoked or unknown key | | `401` | `{"detail": "..."}` | Expired or invalid OAuth access token. Refresh it and retry. | | `403` | `{"detail": "Missing scope: x:y"}` | The key is valid but lacks the scope for this endpoint | See [Errors](/developers/errors) for every status code. --- # API keys (/developers/api-keys) > Create, scope, rotate and revoke the workspace API keys that authenticate REST and MCP requests. > **Preview:** this feature is in preview. The contract is stable enough to build against, but details may change before general availability. API keys authenticate server-to-server requests to the Luso8 API and the [remote MCP server](/developers/mcp). Each key belongs to one workspace and carries a set of scopes that limit what it can do. ## Key format [#key-format] Keys start with a fixed prefix followed by 40 random characters: ```text luso8_sk_live_<40 characters> ``` The `luso8_sk_live_` prefix makes keys easy to recognize in logs and by secret scanners. If you find a key somewhere it should not be, revoke it immediately. ## Create a key [#create-a-key] Only workspace **Owners** and **Administrators** can manage API keys. See [Roles](/luso8/settings/roles). ### Open the API keys page [#open-the-api-keys-page] In Luso8, open **Settings → Developers → API keys**. ### Name the key and choose scopes [#name-the-key-and-choose-scopes] Click **Create key**. Give it a name that says where it is used, such as `website-signup-sync` or `data-warehouse-export`, then select the narrowest set of [scopes](#scopes) the integration needs. ### Copy the key [#copy-the-key] The full key is shown **once**. Copy it into your secret manager or environment before closing the dialog. Luso8 stores only a hash, so a lost key cannot be recovered; create a new one instead. ## Use a key [#use-a-key] Send the key as a bearer token, or in the `X-API-Key` header: ```bash tab="Authorization header" curl https://api.luso8.rexplore.ai/api/v1/companies \ -H "Authorization: Bearer $LUSO8_API_KEY" ``` ```bash tab="X-API-Key header" curl https://api.luso8.rexplore.ai/api/v1/companies \ -H "X-API-Key: $LUSO8_API_KEY" ``` ## Scopes [#scopes] A scope is `:read` or `:write`. Write includes read, so a key with `deals:write` can also list deals. The special scope `*` grants full access to every resource, including resources added later. | Resource | `read` lets you | `write` also lets you | | --- | --- | --- | | `contacts` | List, search and get contacts | Create, bulk create, update and delete contacts, set custom fields | | `companies` | List, search, count and get companies | Create, bulk create, update and delete companies | | `deals` | Read deals, prospects, customers, products and pipeline summaries | Create and update them, convert leads to deals and deals to customers | | `leads` | Read leads and AI lead search results | Create and update leads, start, answer and cancel lead searches | | `lists` | Read lists and their members | Create lists, add and remove contacts | | `campaigns` | Read campaigns, steps, enrolled contacts and analytics | Create and edit campaigns and steps, enroll contacts, launch, pause, resume | | `conversations` | Read inbox and support conversations and messages | Send messages, update status or assignment, hand off to a human | | `calls` | Read call logs, recordings, performance and scheduled calls | Schedule, update and cancel calls, update call logs | | `appointments` | Read appointments, upcoming meetings and stats | Create, update, cancel and change the status of appointments | | `tickets` | Read tickets, categories and comments | Create, update and delete tickets, add comments | | `agents` | Read AI agents, voice agents and their conversations | Create, update, enable and disable agents | | `knowledge` | Read folders, documents and search the knowledge base | Create folders, upload and delete documents | | `workflows` | Read workflows, events and runs | Create and edit workflows, trigger and cancel runs | | `reports` | Read workspace metrics and export reports | (no write operations) | ## Rotate a key [#rotate-a-key] Rotate keys on a schedule and whenever someone with access leaves the team: 1. Create a new key with the same scopes. 2. Deploy it to your integration and confirm requests succeed. 3. Revoke the old key. Revoking takes effect immediately: the next request with that key returns `401 Invalid API key`. ## Best practices [#best-practices] - **One key per integration.** You can revoke one integration without breaking the others, and the key name tells you what will stop. - **Least privilege.** Grant `read` unless the integration writes, and avoid `*` outside short-lived experiments. - **Server only.** Never ship a key in a browser, a mobile app or client-side code. Proxy requests through your backend. - **Keep keys out of URLs and logs.** Send them in headers, and mask them in your own logging. - **Watch the rate limit.** Each key gets 600 requests per minute; see [Rate limits](/developers/rate-limits). --- # API reference (/developers/api-reference) > Conventions shared by every Luso8 REST endpoint, and an index of the resources you can work with. > **Preview:** The reference below is generated from the Luso8 OpenAPI schema. Endpoints and fields may still change before general availability; breaking changes will be announced in advance. The Luso8 REST API is organized around resources such as contacts, deals and tickets. It uses standard HTTP methods, JSON request and response bodies, and conventional status codes. Browse the sidebar for every endpoint, with parameters, response schemas and an interactive playground. ## Base URL [#base-url] ```text https://api.luso8.rexplore.ai/api/v1 ``` All paths in the reference are absolute, for example `GET /api/v1/contacts`. ## Authentication [#authentication] Send a workspace API key as a bearer token or in `X-API-Key`. See [Authentication](/developers/authentication). ```bash curl https://api.luso8.rexplore.ai/api/v1/tickets \ -H "Authorization: Bearer $LUSO8_API_KEY" ``` Each endpoint lists its **required scope**, for example `tickets:read` for `GET` requests and `tickets:write` for everything else. A key without it receives `403 Missing scope: tickets:write`. ## Requests and responses [#requests-and-responses] | Convention | Details | | --- | --- | | Content type | Send `Content-Type: application/json` with request bodies. Responses are JSON unless stated otherwise (for example, report exports return PDF). | | IDs | Resource IDs are opaque strings. Store them as strings and do not parse them. | | Timestamps | ISO 8601 in UTC, for example `2026-11-22T14:05:31.120Z`. | | Nulls | Optional fields that have no value are returned as `null`. | | Updates | `PUT` and `PATCH` accept partial bodies; fields you omit keep their current value. | ## Pagination [#pagination] List endpoints use offset pagination with two query parameters: | Parameter | Description | | --- | --- | | `skip` | Number of records to skip. Defaults to `0`. | | `limit` | Maximum number of records to return. The default depends on the endpoint, for example `100` for contacts and `50` for deals and tickets. | Fetch pages until a response returns fewer records than `limit`: ```js title="paginate.js" async function* listAll(path, pageSize = 100) { for (let skip = 0; ; skip += pageSize) { const url = new URL(`https://api.luso8.rexplore.ai/api/v1${path}`); url.searchParams.set('skip', String(skip)); url.searchParams.set('limit', String(pageSize)); const res = await fetch(url, { headers: { Authorization: `Bearer ${process.env.LUSO8_API_KEY}` } }); if (!res.ok) throw new Error(`HTTP ${res.status}`); const page = await res.json(); yield* page; if (page.length < pageSize) return; } } for await (const contact of listAll('/contacts')) console.log(contact.id); ``` Some endpoints wrap results in an object with the items and a total, such as tickets. The response schema of each endpoint shows its exact shape. ## Resources [#resources] | Resource | Scope | What it covers | | --- | --- | --- | | Contacts | `contacts` | People in your CRM, with custom fields | | Companies | `companies` | Organizations your contacts belong to | | Deals | `deals` | Deals, prospects, customers, products and pipeline summaries | | Leads | `leads` | Qualified leads, and AI lead search runs | | Lists | `lists` | Static lists of contacts for campaigns and dialing | | Campaigns | `campaigns` | Multi-step, multi-channel sequences, enrollment and analytics | | Conversations | `conversations` | Inbox and support conversations and messages across every channel | | Calls | `calls` | Call logs, recordings, performance and scheduled calls | | Appointments | `appointments` | Meetings and bookings on your team's calendars | | Tickets | `tickets` | Customer issues and their comments | | Agents | `agents` | AI agents, voice agents and their conversations | | Knowledge | `knowledge` | Knowledge base folders, documents and semantic search | | Workflows | `workflows` | Event-driven AI workflows, triggers and runs | | Reports | `reports` | Workspace metrics, activity and PDF exports | ## OpenAPI schema [#openapi-schema] Download the schema to generate a client, or import it into Postman or Insomnia: ```bash curl -o luso8.json https://docs.rexplore.ai/openapi/luso8.json ``` ## Related [#related] 600 requests per minute per key. Status codes and error bodies. Scopes and key management. A complete example. --- # Create Agent (/developers/api-reference/agents/create-agent) Create a new agent **Required scope:** `agents:write` - `POST /api/v1/agents` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Create Voice Agent (/developers/api-reference/agents/create-voice-agent) Create a new voice agent linked to an existing agent. **Required scope:** `agents:write` - `POST /api/v1/voice-agents` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Delete Agent (/developers/api-reference/agents/delete-agent) Delete an agent **Required scope:** `agents:write` - `DELETE /api/v1/agents/{agent_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Delete Voice Agent (/developers/api-reference/agents/delete-voice-agent) Delete a voice agent. **Required scope:** `agents:write` - `DELETE /api/v1/voice-agents/{voice_agent_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Agent Conversation (/developers/api-reference/agents/get-agent-conversation) Get a specific conversation with messages **Required scope:** `agents:read` - `GET /api/v1/agents/conversations/{conversation_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Agent (/developers/api-reference/agents/get-agent) Get a specific agent **Required scope:** `agents:read` - `GET /api/v1/agents/{agent_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Voice Agent (/developers/api-reference/agents/get-voice-agent) Get a voice agent by ID. **Required scope:** `agents:read` - `GET /api/v1/voice-agents/{voice_agent_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Agent Conversations (/developers/api-reference/agents/list-agent-conversations) List conversations for an agent **Required scope:** `agents:read` - `GET /api/v1/agents/{agent_id}/conversations` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Agent Messages (/developers/api-reference/agents/list-agent-messages) List messages in a conversation **Required scope:** `agents:read` - `GET /api/v1/agents/conversations/{conversation_id}/messages` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Agents (/developers/api-reference/agents/list-agents) List agents for the current organization. **Required scope:** `agents:read` - `GET /api/v1/agents` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Voice Agents (/developers/api-reference/agents/list-voice-agents) List voice agents for the current organization. **Required scope:** `agents:read` - `GET /api/v1/voice-agents` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Agent Status (/developers/api-reference/agents/update-agent-status) Update agent status **Required scope:** `agents:write` - `PATCH /api/v1/agents/{agent_id}/status` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Agent (/developers/api-reference/agents/update-agent) Update an agent **Required scope:** `agents:write` - `PUT /api/v1/agents/{agent_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Voice Agent (/developers/api-reference/agents/update-voice-agent) Update a voice agent. **Required scope:** `agents:write` - `PUT /api/v1/voice-agents/{voice_agent_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Create Appointment (/developers/api-reference/appointments/create-appointment) Create a new appointment. **Required scope:** `appointments:write` - `POST /api/v1/appointments` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Delete Appointment (/developers/api-reference/appointments/delete-appointment) Delete an appointment and remove from Google Calendar if connected. **Required scope:** `appointments:write` - `DELETE /api/v1/appointments/{appointment_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Appointment Stats (/developers/api-reference/appointments/get-appointment-stats) Get appointment statistics. **Required scope:** `appointments:read` - `GET /api/v1/appointments/stats` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Appointment (/developers/api-reference/appointments/get-appointment) Get a single appointment by ID. **Required scope:** `appointments:read` - `GET /api/v1/appointments/{appointment_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Appointments In Range (/developers/api-reference/appointments/get-appointments-in-range) Get all appointments in a date range (for calendar view). **Required scope:** `appointments:read` - `GET /api/v1/appointments/range` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Upcoming Appointments (/developers/api-reference/appointments/get-upcoming-appointments) Get upcoming appointments. **Required scope:** `appointments:read` - `GET /api/v1/appointments/upcoming` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Appointments (/developers/api-reference/appointments/list-appointments) List appointments for the current user's organization. **Required scope:** `appointments:read` - `GET /api/v1/appointments` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Appointment Status (/developers/api-reference/appointments/update-appointment-status) Update appointment status (confirm, cancel, complete, no-show). **Required scope:** `appointments:write` - `PATCH /api/v1/appointments/{appointment_id}/status` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Appointment (/developers/api-reference/appointments/update-appointment) Update an appointment and sync with Google Calendar if connected. **Required scope:** `appointments:write` - `PUT /api/v1/appointments/{appointment_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Cancel Scheduled Call (/developers/api-reference/calls/cancel-scheduled-call) Cancel a pending scheduled call. **Required scope:** `calls:write` - `POST /api/v1/voice-calls/scheduled/{call_id}/cancel` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Create Scheduled Call (/developers/api-reference/calls/create-scheduled-call) Schedule an outbound call. **Required scope:** `calls:write` - `POST /api/v1/voice-calls/scheduled` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Delete Scheduled Call (/developers/api-reference/calls/delete-scheduled-call) Delete a scheduled call. **Required scope:** `calls:write` - `DELETE /api/v1/voice-calls/scheduled/{call_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Call Log Recording Url (/developers/api-reference/calls/get-call-log-recording-url) **Required scope:** `calls:read` - `GET /api/v1/voice-calls/logs/{call_log_id}/recording-url` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Call Log (/developers/api-reference/calls/get-call-log) Get a specific call log. **Required scope:** `calls:read` - `GET /api/v1/voice-calls/logs/{call_log_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Call (/developers/api-reference/calls/get-call) Get a call session by ID. **Required scope:** `calls:read` - `GET /api/v1/call-center/calls/{call_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Performance Stats (/developers/api-reference/calls/get-performance-stats) Get call performance statistics and KPIs (practice calls excluded). **Required scope:** `calls:read` - `GET /api/v1/voice-calls/performance` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Scheduled Call (/developers/api-reference/calls/get-scheduled-call) Get a specific scheduled call. **Required scope:** `calls:read` - `GET /api/v1/voice-calls/scheduled/{call_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Call Logs (/developers/api-reference/calls/list-call-logs) List call logs for the organization with optional filters. **Required scope:** `calls:read` - `GET /api/v1/voice-calls/logs` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Calls (/developers/api-reference/calls/list-calls) List call sessions with filters. **Required scope:** `calls:read` - `GET /api/v1/call-center/calls` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Scheduled Calls (/developers/api-reference/calls/list-scheduled-calls) List scheduled calls for the organization. **Required scope:** `calls:read` - `GET /api/v1/voice-calls/scheduled` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Call Log (/developers/api-reference/calls/update-call-log) Update a call log entry. **Required scope:** `calls:write` - `PATCH /api/v1/voice-calls/logs/{call_log_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Scheduled Call (/developers/api-reference/calls/update-scheduled-call) Update a scheduled call (status, error_message, etc.). **Required scope:** `calls:write` - `PATCH /api/v1/voice-calls/scheduled/{call_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Add Contact To Campaign (/developers/api-reference/campaigns/add-contact-to-campaign) Add a single contact to a campaign **Required scope:** `campaigns:write` - `POST /api/v1/campaigns/{campaign_id}/contacts` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Add Contacts From Lists (/developers/api-reference/campaigns/add-contacts-from-lists) Add contacts from lists to a campaign **Required scope:** `campaigns:write` - `POST /api/v1/campaigns/{campaign_id}/contacts/from-lists` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Archive Campaign (/developers/api-reference/campaigns/archive-campaign) Archive a campaign: it stops running and keeps all of its history. **Required scope:** `campaigns:write` - `POST /api/v1/campaigns/{campaign_id}/archive` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Complete Campaign (/developers/api-reference/campaigns/complete-campaign) Mark a campaign as completed **Required scope:** `campaigns:write` - `POST /api/v1/campaigns/{campaign_id}/complete` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Create Campaign Step (/developers/api-reference/campaigns/create-campaign-step) Add a step to a campaign **Required scope:** `campaigns:write` - `POST /api/v1/campaigns/{campaign_id}/steps` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Create Campaign (/developers/api-reference/campaigns/create-campaign) Create a new campaign. **Required scope:** `campaigns:write` - `POST /api/v1/campaigns` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Delete Campaign Step (/developers/api-reference/campaigns/delete-campaign-step) Delete a campaign step **Required scope:** `campaigns:write` - `DELETE /api/v1/campaigns/{campaign_id}/steps/{step_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Delete Campaign (/developers/api-reference/campaigns/delete-campaign) Delete a campaign that has never sent anything. **Required scope:** `campaigns:write` - `DELETE /api/v1/campaigns/{campaign_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Campaign Analytics (/developers/api-reference/campaigns/get-campaign-analytics) Basic analytics for a campaign's current run. **Required scope:** `campaigns:read` - `GET /api/v1/campaigns/{campaign_id}/analytics` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Campaign (/developers/api-reference/campaigns/get-campaign) Get a campaign by ID with all details **Required scope:** `campaigns:read` - `GET /api/v1/campaigns/{campaign_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Campaigns Stats (/developers/api-reference/campaigns/get-campaigns-stats) Campaign counts per status, from one grouped query. **Required scope:** `campaigns:read` - `GET /api/v1/campaigns/stats` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Campaigns Summary (/developers/api-reference/campaigns/get-campaigns-summary) Get summary analytics for all campaigns in the organization **Required scope:** `campaigns:read` - `GET /api/v1/campaigns/analytics/summary` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Launch Campaign (/developers/api-reference/campaigns/launch-campaign) Launch a campaign **Required scope:** `campaigns:write` - `POST /api/v1/campaigns/{campaign_id}/launch` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Campaign Contacts (/developers/api-reference/campaigns/list-campaign-contacts) List contacts in a campaign **Required scope:** `campaigns:read` - `GET /api/v1/campaigns/{campaign_id}/contacts` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Campaign Steps (/developers/api-reference/campaigns/list-campaign-steps) List all steps for a campaign **Required scope:** `campaigns:read` - `GET /api/v1/campaigns/{campaign_id}/steps` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Campaigns (/developers/api-reference/campaigns/list-campaigns) List campaigns for the organization, one page at a time. **Required scope:** `campaigns:read` - `GET /api/v1/campaigns` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Pause Campaign (/developers/api-reference/campaigns/pause-campaign) Pause a campaign **Required scope:** `campaigns:write` - `POST /api/v1/campaigns/{campaign_id}/pause` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Remove Contact From Campaign (/developers/api-reference/campaigns/remove-contact-from-campaign) Remove a contact from a campaign **Required scope:** `campaigns:write` - `DELETE /api/v1/campaigns/{campaign_id}/contacts/{contact_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Resume Campaign (/developers/api-reference/campaigns/resume-campaign) Resume a paused campaign **Required scope:** `campaigns:write` - `POST /api/v1/campaigns/{campaign_id}/resume` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Campaign Step (/developers/api-reference/campaigns/update-campaign-step) Update a campaign step **Required scope:** `campaigns:write` - `PUT /api/v1/campaigns/{campaign_id}/steps/{step_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Campaign (/developers/api-reference/campaigns/update-campaign) Update a campaign **Required scope:** `campaigns:write` - `PUT /api/v1/campaigns/{campaign_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Bulk Create Companies (/developers/api-reference/companies/bulk-create-companies) Bulk create companies (``acting_user_id``: see POST /companies). **Required scope:** `companies:write` - `POST /api/v1/companies/bulk` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Count Companies (/developers/api-reference/companies/count-companies) Count companies with the same filters as the list route. **Required scope:** `companies:read` - `GET /api/v1/companies/count` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Create Company (/developers/api-reference/companies/create-company) Create a new company. **Required scope:** `companies:write` - `POST /api/v1/companies` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Delete Company (/developers/api-reference/companies/delete-company) Delete a company **Required scope:** `companies:write` - `DELETE /api/v1/companies/{company_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Company (/developers/api-reference/companies/get-company) Get a specific company with full pipeline data **Required scope:** `companies:read` - `GET /api/v1/companies/{company_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Companies (/developers/api-reference/companies/list-companies) Get all companies with optional filtering. **Required scope:** `companies:read` - `GET /api/v1/companies` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Search Companies (/developers/api-reference/companies/search-companies) Search companies by name, description, industry, or notes **Required scope:** `companies:read` - `GET /api/v1/companies/search` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Company (/developers/api-reference/companies/update-company) Update a company **Required scope:** `companies:write` - `PUT /api/v1/companies/{company_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Bulk Create Contacts (/developers/api-reference/contacts/bulk-create-contacts) Bulk create contacts (CSV import). **Required scope:** `contacts:write` - `POST /api/v1/contacts/bulk` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Create Contact (/developers/api-reference/contacts/create-contact) Create a new contact **Required scope:** `contacts:write` - `POST /api/v1/contacts` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Delete Contact (/developers/api-reference/contacts/delete-contact) Delete a contact **Required scope:** `contacts:write` - `DELETE /api/v1/contacts/{contact_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Contact (/developers/api-reference/contacts/get-contact) Get a specific contact with full pipeline data **Required scope:** `contacts:read` - `GET /api/v1/contacts/{contact_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Contacts (/developers/api-reference/contacts/list-contacts) Get contacts, newest first. Every filter given applies (AND): ``status``, ``search``, ``country`` (English name, whole value, case-insensitive), ``enrichment_status`` (repeatable: ``completed``, ``failed``, ``none`` = never enriched), ``list_ids`` and ``exclude_list_ids``. **Required scope:** `contacts:read` - `GET /api/v1/contacts` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Contact Extras (/developers/api-reference/contacts/update-contact-extras) Set per-org custom field values on a contact. **Required scope:** `contacts:write` - `PATCH /api/v1/contacts/{contact_id}/extras` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Contact (/developers/api-reference/contacts/update-contact) Update a contact **Required scope:** `contacts:write` - `PUT /api/v1/contacts/{contact_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Create Inbox Conversation (/developers/api-reference/conversations/create-inbox-conversation) **Required scope:** `conversations:write` - `POST /api/v1/engage-inbox/conversations` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Create Support Conversation (/developers/api-reference/conversations/create-support-conversation) **Required scope:** `conversations:write` - `POST /api/v1/support-chat/conversations` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Inbox Conversation (/developers/api-reference/conversations/get-inbox-conversation) **Required scope:** `conversations:read` - `GET /api/v1/engage-inbox/conversations/{conversation_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Support Conversation (/developers/api-reference/conversations/get-support-conversation) **Required scope:** `conversations:read` - `GET /api/v1/support-chat/conversations/{conversation_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Hand Off Support Conversation (/developers/api-reference/conversations/hand-off-support-conversation) Mark the conversation as needing a human: AI replies pause, the reason **Required scope:** `conversations:write` - `POST /api/v1/support-chat/conversations/{conversation_id}/handoff` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Inbox Conversation Messages (/developers/api-reference/conversations/list-inbox-conversation-messages) The NEWEST `limit` messages of a thread, oldest first. **Required scope:** `conversations:read` - `GET /api/v1/engage-inbox/conversations/{conversation_id}/messages` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Inbox Conversations (/developers/api-reference/conversations/list-inbox-conversations) One page of conversations, newest activity first. **Required scope:** `conversations:read` - `GET /api/v1/engage-inbox/conversations` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Inbox Messages (/developers/api-reference/conversations/list-inbox-messages) One page of a thread, oldest first: `{items, total, has_more}`. **Required scope:** `conversations:read` - `GET /api/v1/engage-inbox/messages` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Support Conversations (/developers/api-reference/conversations/list-support-conversations) **Required scope:** `conversations:read` - `GET /api/v1/support-chat/conversations` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Support Messages (/developers/api-reference/conversations/list-support-messages) **Required scope:** `conversations:read` - `GET /api/v1/support-chat/conversations/{conversation_id}/messages` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Send Inbox Message (/developers/api-reference/conversations/send-inbox-message) Send an outbound message, creating a new conversation if needed. **Required scope:** `conversations:write` - `POST /api/v1/engage-inbox/messages` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Send Support Message (/developers/api-reference/conversations/send-support-message) **Required scope:** `conversations:write` - `POST /api/v1/support-chat/conversations/{conversation_id}/messages` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Inbox Conversation (/developers/api-reference/conversations/update-inbox-conversation) **Required scope:** `conversations:write` - `PATCH /api/v1/engage-inbox/conversations/{conversation_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Support Conversation (/developers/api-reference/conversations/update-support-conversation) **Required scope:** `conversations:write` - `PATCH /api/v1/support-chat/conversations/{conversation_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Close Deal As Customer (/developers/api-reference/deals/close-deal-as-customer) Close a Deal as won and convert it into a Customer ("Close as Won"). **Required scope:** `deals:write` - `POST /api/v1/deals/customers/from-deal/{deal_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Count Deals (/developers/api-reference/deals/count-deals) Count deals with the same filters as the list route (page totals). **Required scope:** `deals:read` - `GET /api/v1/deals/deals/count` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Create Customer (/developers/api-reference/deals/create-customer) **Required scope:** `deals:write` - `POST /api/v1/deals/customers` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Create Deal From Lead (/developers/api-reference/deals/create-deal-from-lead) Promote a Lead to a Deal when it becomes sales-qualified. **Required scope:** `deals:write` - `POST /api/v1/deals/deals/from-lead/{lead_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Create Deal (/developers/api-reference/deals/create-deal) **Required scope:** `deals:write` - `POST /api/v1/deals/deals` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Create Product (/developers/api-reference/deals/create-product) **Required scope:** `deals:write` - `POST /api/v1/deals/products` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Create Prospect (/developers/api-reference/deals/create-prospect) **Required scope:** `deals:write` - `POST /api/v1/deals/prospects` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Delete Customer (/developers/api-reference/deals/delete-customer) **Required scope:** `deals:write` - `DELETE /api/v1/deals/customers/{customer_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Delete Deal (/developers/api-reference/deals/delete-deal) **Required scope:** `deals:write` - `DELETE /api/v1/deals/deals/{deal_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Delete Product (/developers/api-reference/deals/delete-product) Delete a product that is not on any deal. A product that is attached to deals answers 409 ``product_in_use`` - archive it instead so the deal history keeps its line items. **Required scope:** `deals:write` - `DELETE /api/v1/deals/products/{product_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Delete Prospect (/developers/api-reference/deals/delete-prospect) **Required scope:** `deals:write` - `DELETE /api/v1/deals/prospects/{prospect_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Customer (/developers/api-reference/deals/get-customer) **Required scope:** `deals:read` - `GET /api/v1/deals/customers/{customer_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Deal (/developers/api-reference/deals/get-deal) **Required scope:** `deals:read` - `GET /api/v1/deals/deals/{deal_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Product (/developers/api-reference/deals/get-product) **Required scope:** `deals:read` - `GET /api/v1/deals/products/{product_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Prospect (/developers/api-reference/deals/get-prospect) **Required scope:** `deals:read` - `GET /api/v1/deals/prospects/{prospect_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Customers (/developers/api-reference/deals/list-customers) **Required scope:** `deals:read` - `GET /api/v1/deals/customers` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Deals (/developers/api-reference/deals/list-deals) **Required scope:** `deals:read` - `GET /api/v1/deals/deals` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Products (/developers/api-reference/deals/list-products) **Required scope:** `deals:read` - `GET /api/v1/deals/products` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Prospects (/developers/api-reference/deals/list-prospects) **Required scope:** `deals:read` - `GET /api/v1/deals/prospects` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Pipeline Summary (/developers/api-reference/deals/pipeline-summary) **Required scope:** `deals:read` - `GET /api/v1/deals/deals/pipeline-summary` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Customer (/developers/api-reference/deals/update-customer) **Required scope:** `deals:write` - `PUT /api/v1/deals/customers/{customer_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Deal (/developers/api-reference/deals/update-deal) **Required scope:** `deals:write` - `PUT /api/v1/deals/deals/{deal_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Product (/developers/api-reference/deals/update-product) Update a product. Archiving / restoring is ``{"status": "archived"}`` / ``{"status": "active"}`` through this route. **Required scope:** `deals:write` - `PUT /api/v1/deals/products/{product_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Prospect (/developers/api-reference/deals/update-prospect) **Required scope:** `deals:write` - `PUT /api/v1/deals/prospects/{prospect_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Create Folder (/developers/api-reference/knowledge/create-folder) Create a new knowledge folder. **Required scope:** `knowledge:write` - `POST /api/v1/knowledge/folders` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Create Markdown (/developers/api-reference/knowledge/create-markdown) Create a markdown document. **Required scope:** `knowledge:write` - `POST /api/v1/knowledge/folders/{folder_id}/documents/markdown` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Delete Document (/developers/api-reference/knowledge/delete-document) Delete a document. **Required scope:** `knowledge:write` - `DELETE /api/v1/knowledge/documents/{document_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Delete Folder (/developers/api-reference/knowledge/delete-folder) Delete a folder and all its documents. **Required scope:** `knowledge:write` - `DELETE /api/v1/knowledge/folders/{folder_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Document (/developers/api-reference/knowledge/get-document) Get a specific document. **Required scope:** `knowledge:read` - `GET /api/v1/knowledge/documents/{document_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Folder (/developers/api-reference/knowledge/get-folder) Get a specific folder. **Required scope:** `knowledge:read` - `GET /api/v1/knowledge/folders/{folder_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Stats (/developers/api-reference/knowledge/get-stats) Get overall knowledge base statistics. **Required scope:** `knowledge:read` - `GET /api/v1/knowledge/stats` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Documents (/developers/api-reference/knowledge/list-documents) List documents in a folder. **Required scope:** `knowledge:read` - `GET /api/v1/knowledge/folders/{folder_id}/documents` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Folders (/developers/api-reference/knowledge/list-folders) List all knowledge folders for the organization. **Required scope:** `knowledge:read` - `GET /api/v1/knowledge/folders` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Search Knowledge (/developers/api-reference/knowledge/search-knowledge) Search across knowledge base using semantic search. **Required scope:** `knowledge:write` - `POST /api/v1/knowledge/search` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Folder (/developers/api-reference/knowledge/update-folder) Update a folder. **Required scope:** `knowledge:write` - `PUT /api/v1/knowledge/folders/{folder_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Upload Document (/developers/api-reference/knowledge/upload-document) Upload a document file (PDF, TXT, CSV, Excel; images and Word with the pipeline). **Required scope:** `knowledge:write` - `POST /api/v1/knowledge/folders/{folder_id}/documents/upload` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Cancel Research Task (/developers/api-reference/leads/cancel-research-task) Cancel a running or paused search (revokes the worker task). **Required scope:** `leads:write` - `POST /api/v1/research/{task_id}/cancel` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Count Leads (/developers/api-reference/leads/count-leads) Count leads with the same filters as the list route (page totals). **Required scope:** `leads:read` - `GET /api/v1/deals/leads/count` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Create Lead (/developers/api-reference/leads/create-lead) **Required scope:** `leads:write` - `POST /api/v1/deals/leads` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Delete Lead (/developers/api-reference/leads/delete-lead) **Required scope:** `leads:write` - `DELETE /api/v1/deals/leads/{lead_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Active Research Tasks (/developers/api-reference/leads/get-active-research-tasks) Searches still running or waiting for the person's input, for the current organization. Used on page load to reattach to in-flight searches. **Required scope:** `leads:read` - `GET /api/v1/research/active` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Lead (/developers/api-reference/leads/get-lead) **Required scope:** `leads:read` - `GET /api/v1/deals/leads/{lead_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Research Status (/developers/api-reference/leads/get-research-status) Get the status and results of a research task. **Required scope:** `leads:read` - `GET /api/v1/research/results/{task_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Initiate Lead Search (/developers/api-reference/leads/initiate-lead-search) Initiate a new deep research task. **Required scope:** `leads:write` - `POST /api/v1/research` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Leads (/developers/api-reference/leads/list-leads) **Required scope:** `leads:read` - `GET /api/v1/deals/leads` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Promote Prospect To Lead (/developers/api-reference/leads/promote-prospect-to-lead) Promote an ICP-matched Prospect to a Lead once they engage. **Required scope:** `leads:write` - `POST /api/v1/deals/leads/from-prospect/{prospect_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Respond To Research Review (/developers/api-reference/leads/respond-to-research-review) Answer a review point (approve/edit the plan; accept/continue/stop at quality review) and resume the search in the background. **Required scope:** `leads:write` - `POST /api/v1/research/{task_id}/respond` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Lead (/developers/api-reference/leads/update-lead) **Required scope:** `leads:write` - `PUT /api/v1/deals/leads/{lead_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Add Contacts To List (/developers/api-reference/lists/add-contacts-to-list) Add contacts to a list. **Required scope:** `lists:write` - `POST /api/v1/lists/{list_id}/contacts` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Create List (/developers/api-reference/lists/create-list) Create new list **Required scope:** `lists:write` - `POST /api/v1/lists` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Delete List (/developers/api-reference/lists/delete-list) Delete list **Required scope:** `lists:write` - `DELETE /api/v1/lists/{list_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get List (/developers/api-reference/lists/get-list) Get list by ID **Required scope:** `lists:read` - `GET /api/v1/lists/{list_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List List With Contacts (/developers/api-reference/lists/list-list-with-contacts) Get list with its contacts **Required scope:** `lists:read` - `GET /api/v1/lists/{list_id}/contacts` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Lists (/developers/api-reference/lists/list-lists) Retrieve lists for the organization with optional filtering **Required scope:** `lists:read` - `GET /api/v1/lists` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Remove Contacts From List (/developers/api-reference/lists/remove-contacts-from-list) Remove contacts from a list (the contacts themselves are kept). **Required scope:** `lists:write` - `DELETE /api/v1/lists/{list_id}/contacts` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Search Lists (/developers/api-reference/lists/search-lists) Search lists by name or description **Required scope:** `lists:read` - `GET /api/v1/lists/search` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update List (/developers/api-reference/lists/update-list) Update list **Required scope:** `lists:write` - `PUT /api/v1/lists/{list_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Export Report Overview Pdf (/developers/api-reference/reports/export-report-overview-pdf) Live report for the period as a PDF (cover, one page per section, signature block). Same data as GET /content/reports/overview. **Required scope:** `reports:read` - `GET /api/v1/reports/export.pdf` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Dashboard Activity (/developers/api-reference/reports/get-dashboard-activity) Recent events across the organisation for a period, newest first: contacts, companies, intent signals, conversations, tickets, calls, appointments, pipeline records, deals, campaigns and published articles. **Required scope:** `reports:read` - `GET /api/v1/dashboard/activity` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Dashboard Stats (/developers/api-reference/reports/get-dashboard-stats) Get dashboard statistics for the current user's organization **Required scope:** `reports:read` - `GET /api/v1/dashboard/stats` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Add Comment (/developers/api-reference/tickets/add-comment) **Required scope:** `tickets:write` - `POST /api/v1/tickets/{ticket_id}/comments` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Create Ticket (/developers/api-reference/tickets/create-ticket) **Required scope:** `tickets:write` - `POST /api/v1/tickets` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Delete Ticket (/developers/api-reference/tickets/delete-ticket) **Required scope:** `tickets:write` - `DELETE /api/v1/tickets/{ticket_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Ticket (/developers/api-reference/tickets/get-ticket) **Required scope:** `tickets:read` - `GET /api/v1/tickets/{ticket_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Categories (/developers/api-reference/tickets/list-categories) Categories already used in the org (most used first) followed by the defaults. **Required scope:** `tickets:read` - `GET /api/v1/tickets/categories` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Comments (/developers/api-reference/tickets/list-comments) Comments and system notes, oldest first. **Required scope:** `tickets:read` - `GET /api/v1/tickets/{ticket_id}/comments` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Tickets (/developers/api-reference/tickets/list-tickets) **Required scope:** `tickets:read` - `GET /api/v1/tickets` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Ticket (/developers/api-reference/tickets/update-ticket) **Required scope:** `tickets:write` - `PUT /api/v1/tickets/{ticket_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Cancel Workflow Run (/developers/api-reference/workflows/cancel-workflow-run) **Required scope:** `workflows:write` - `POST /api/v1/ai-workflows/{workflow_id}/runs/{run_id}/cancel` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Create Workflow (/developers/api-reference/workflows/create-workflow) Create a new workflow. **Required scope:** `workflows:write` - `POST /api/v1/ai-workflows` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Delete Workflow (/developers/api-reference/workflows/delete-workflow) Delete a workflow. **Required scope:** `workflows:write` - `DELETE /api/v1/ai-workflows/{workflow_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Run (/developers/api-reference/workflows/get-run) Get a specific run with step details. **Required scope:** `workflows:read` - `GET /api/v1/ai-workflows/{workflow_id}/runs/{run_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Get Workflow (/developers/api-reference/workflows/get-workflow) Get a workflow with steps. **Required scope:** `workflows:read` - `GET /api/v1/ai-workflows/{workflow_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Runs (/developers/api-reference/workflows/list-runs) List runs for a workflow. **Required scope:** `workflows:read` - `GET /api/v1/ai-workflows/{workflow_id}/runs` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Workflow Events (/developers/api-reference/workflows/list-workflow-events) Platform events a workflow can be triggered by (with sample payloads). **Required scope:** `workflows:read` - `GET /api/v1/ai-workflows/events` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # List Workflows (/developers/api-reference/workflows/list-workflows) List all workflows for the organization. **Required scope:** `workflows:read` - `GET /api/v1/ai-workflows` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Trigger Workflow (/developers/api-reference/workflows/trigger-workflow) Start a run now. **Required scope:** `workflows:write` - `POST /api/v1/ai-workflows/{workflow_id}/trigger` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Update Workflow (/developers/api-reference/workflows/update-workflow) Update a workflow. Activating requires a clean compile. **Required scope:** `workflows:write` - `PUT /api/v1/ai-workflows/{workflow_id}` Full schema: https://docs.rexplore.ai/openapi/luso8.json --- # Rate limits (/developers/rate-limits) > Each API key can make 600 requests per minute; response headers tell you how much of the budget is left. > **Preview:** this feature is in preview. The contract is stable enough to build against, but details may change before general availability. The Luso8 API limits how many requests each API key can make so that one integration cannot slow down a workspace. Limits are counted **per key**, not per workspace or IP address. ## The limit [#the-limit] | Limit | Window | | --- | --- | | 600 requests | per minute, per API key | Every request counts, including requests that fail validation. ## Rate limit headers [#rate-limit-headers] Every response includes headers that describe the current window: | Header | Description | | --- | --- | | `X-RateLimit-Limit` | The number of requests allowed in the window (`600`). | | `X-RateLimit-Remaining` | Requests left in the current window. | | `X-RateLimit-Reset` | When the window resets, as a Unix timestamp in seconds. | ```http HTTP/1.1 200 OK Content-Type: application/json X-RateLimit-Limit: 600 X-RateLimit-Remaining: 587 X-RateLimit-Reset: 1795361460 ``` ## When you exceed the limit [#when-you-exceed-the-limit] Requests over the limit are rejected with `429 Too Many Requests` and a `Retry-After` header with the number of seconds to wait: ```http HTTP/1.1 429 Too Many Requests Content-Type: application/json Retry-After: 12 { "detail": "Rate limit exceeded" } ``` ## Handling 429 responses [#handling-429-responses] Wait for `Retry-After` seconds, then retry. If the header is missing, back off exponentially with jitter. Cap the number of attempts so a stuck job fails loudly instead of looping. ```js tab="JavaScript" async function luso8Fetch(url, init = {}, maxAttempts = 5) { for (let attempt = 1; ; attempt++) { const res = await fetch(url, { ...init, headers: { Authorization: `Bearer ${process.env.LUSO8_API_KEY}`, ...init.headers }, }); if (res.status !== 429 || attempt === maxAttempts) return res; const retryAfter = Number(res.headers.get('Retry-After')); const delayMs = Number.isFinite(retryAfter) && retryAfter > 0 ? retryAfter * 1000 : Math.min(30_000, 500 * 2 ** attempt) + Math.random() * 250; await new Promise((resolve) => setTimeout(resolve, delayMs)); } } ``` ```python tab="Python" import os import random import time import requests session = requests.Session() session.headers["Authorization"] = f"Bearer {os.environ['LUSO8_API_KEY']}" def luso8_request(method: str, url: str, max_attempts: int = 5, **kwargs) -> requests.Response: for attempt in range(1, max_attempts + 1): res = session.request(method, url, timeout=30, **kwargs) if res.status_code != 429 or attempt == max_attempts: return res retry_after = res.headers.get("Retry-After") delay = float(retry_after) if retry_after else min(30, 0.5 * 2**attempt) + random.random() / 4 time.sleep(delay) return res ``` ## Staying under the limit [#staying-under-the-limit] - **Use bulk endpoints.** `POST /api/v1/contacts/bulk` and `POST /api/v1/companies/bulk` create many records in one request. - **Page with large `limit` values** instead of many small pages. - **Pace background jobs** using `X-RateLimit-Remaining` rather than sending bursts. - **Cache reads** that change rarely, such as lists, ticket categories and agents. - **Split unrelated integrations across keys**, so a backfill does not starve a real-time sync. Need a higher limit for a large migration? Email [hello@rexplore.ai](mailto:hello@rexplore.ai) with your workspace name and expected volume. --- # Errors (/developers/errors) > How the Luso8 API reports errors, what each status code means and which requests are safe to retry. > **Preview:** this feature is in preview. The contract is stable enough to build against, but details may change before general availability. The Luso8 API uses conventional HTTP status codes. Codes in the `2xx` range mean success, `4xx` means something about the request needs to change, and `5xx` means something went wrong on our side. ## Error body [#error-body] Errors return a JSON object with a `detail` field. For most errors it is a human-readable message: ```json { "detail": "Invalid API key" } ``` Validation errors (`422`) return `detail` as an array, one entry per invalid field: ```json { "detail": [ { "type": "value_error", "loc": ["body", "email"], "msg": "value is not a valid email address: An email address must have an @-sign.", "input": "ada.lovelace.example.com" }, { "type": "missing", "loc": ["body", "contact_ids"], "msg": "Field required", "input": {} } ] } ``` `loc` is the path to the problem: where it was sent (`body`, `query`, `path`) followed by the field name. Messages are meant for developers and may change. Branch on the status code, not on the message text. ## Status codes [#status-codes] | Status | Meaning | Typical cause | | --- | --- | --- | | `200 OK` / `201 Created` | Success | | | `204 No Content` | Success, no body | Some deletes | | `400 Bad Request` | The request cannot be processed | An operation that is not allowed in the current state, such as launching a campaign that is not reviewed | | `401 Unauthorized` | Not authenticated | `Invalid API key`: missing, malformed, revoked or unknown key, or an expired OAuth token | | `403 Forbidden` | Authenticated, but not allowed | `Missing scope: contacts:write`, or the resource is restricted to admins | | `404 Not Found` | The resource does not exist in this workspace | Wrong ID, or the record belongs to another workspace | | `409 Conflict` | The request conflicts with the current state | Duplicate records, or acting on something that is not active | | `422 Unprocessable Entity` | Validation failed | Missing required fields, wrong types, invalid formats | | `429 Too Many Requests` | Rate limit exceeded | More than 600 requests per minute with one key. See [Rate limits](/developers/rate-limits). | | `500 Internal Server Error` | Unexpected error on our side | Retry later; contact us if it persists | | `502` / `503` / `504` | Temporarily unavailable | Deploys or upstream timeouts. Retry with backoff. | ## Authentication and scope errors [#authentication-and-scope-errors] ```json title="401" { "detail": "Invalid API key" } ``` ```json title="403" { "detail": "Missing scope: contacts:write" } ``` A `403` for a missing scope names the exact scope to add. Create a key with that scope in **Settings → Developers → API keys**, or ask a workspace admin to. See [API keys](/developers/api-keys). ## Retrying [#retrying] | Status | Retry? | | --- | --- | | `429` | Yes, after `Retry-After` seconds | | `500`, `502`, `503`, `504` | Yes, with exponential backoff and jitter, up to a few attempts | | Network errors and timeouts | Yes for `GET`, `PUT` and `DELETE`. For `POST`, check whether the record was created before retrying to avoid duplicates. | | Other `4xx` | No. Fix the request first. | ```python title="retry.py" RETRYABLE = {429, 500, 502, 503, 504} def should_retry(status: int, attempt: int, max_attempts: int = 5) -> bool: return status in RETRYABLE and attempt < max_attempts ``` ## Reporting a problem [#reporting-a-problem] If an error looks wrong, email [hello@rexplore.ai](mailto:hello@rexplore.ai) with the method, path, status code, time of the request (with time zone) and the response body. Never send your API key. --- # Webhooks (/developers/webhooks) > Start Luso8 workflows from your systems with a secret webhook URL, and call your own endpoints from workflows and campaigns. > **Preview:** this feature is in preview. The contract is stable enough to build against, but details may change before general availability. Luso8 connects to your systems over HTTP in two directions today: - **Inbound**: your system calls a secret URL to start a Luso8 [workflow](/luso8/workflows). - **Outbound**: a **Webhook** step in a workflow or a campaign sequence calls your URL with JSON. Luso8 does not yet offer event subscriptions (registering one URL to receive events such as `contact.created` for the whole workspace). Until then, build the same thing with a workflow: trigger it on the event you care about and add a Webhook step that calls your endpoint. ## Inbound: trigger a workflow [#inbound-trigger-a-workflow] Any workflow whose trigger is **Webhook** gets its own secret URL. A `POST` to that URL starts a run, and the JSON body becomes the run's input. ### Create the workflow [#create-the-workflow] In Luso8, open **AI tools → Workflows**, create a workflow and set its trigger to **Webhook**. ### Copy the webhook URL [#copy-the-webhook-url] Open the trigger settings to generate the URL. It has this shape: ```text https://api.luso8.rexplore.ai/api/v1/ai-workflows/hooks// ``` ### Activate the workflow [#activate-the-workflow] Compile and activate the workflow. Only active workflows accept webhook calls. ### Send an event [#send-an-event] ```bash tab="cURL" curl -X POST "$LUSO8_WORKFLOW_WEBHOOK_URL" \ -H "Content-Type: application/json" \ -H "X-Event: order.paid" \ -d '{ "order_id": "ord_1042", "amount": 129.0, "currency": "USD", "customer": { "email": "ada@example.com", "name": "Ada Lovelace" } }' ``` ```js tab="JavaScript" await fetch(process.env.LUSO8_WORKFLOW_WEBHOOK_URL, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Event': 'order.paid' }, body: JSON.stringify({ order_id: 'ord_1042', amount: 129.0, currency: 'USD', customer: { email: 'ada@example.com', name: 'Ada Lovelace' }, }), }); ``` ```python tab="Python" import os import requests requests.post( os.environ["LUSO8_WORKFLOW_WEBHOOK_URL"], headers={"X-Event": "order.paid"}, json={ "order_id": "ord_1042", "amount": 129.0, "currency": "USD", "customer": {"email": "ada@example.com", "name": "Ada Lovelace"}, }, timeout=30, ).raise_for_status() ``` A successful call returns the new run: ```json { "success": true, "run_id": "4a1f0c2e-6a51-4f7e-9d2b-1c8e5b9f3a77", "status": "pending", "dispatched": true, "message": "Workflow triggered" } ``` ### Using the payload in steps [#using-the-payload-in-steps] The body is available to every step as `trigger` (and as `input` for the first step). Step fields accept template expressions, so a notification message could read: ```text New order {{ trigger.order_id }} from {{ trigger.customer.name }} ({{ trigger.amount }} {{ trigger.currency }}) ``` Missing fields resolve to empty values instead of failing, so `{{ trigger.customer.phone or "no phone" }}` is safe. A body that is not a JSON object (for example an array) is wrapped as `{"data": ...}`. The `User-Agent`, `Content-Type` and `X-Event` request headers are added under `_headers`. ### Responses [#responses] | Status | Meaning | | --- | --- | | `200` | The run was created. `dispatched: false` means it is queued and will start shortly. | | `404` `Webhook not found` | Wrong workflow ID or secret, or the workflow's trigger is not Webhook | | `409` `Workflow is not active` | Activate the workflow first | The secret in the path is the only credential. Store the URL like an API key, never in client-side code. If it leaks, deactivate the workflow right away (inactive workflows reject webhook calls with `409`), and contact [hello@rexplore.ai](mailto:hello@rexplore.ai) to rotate the secret. ## Outbound: call your endpoint [#outbound-call-your-endpoint] Add a **Webhook** step to a [workflow](/luso8/workflows) or a [campaign](/luso8/campaigns) sequence to call your own API. | Setting | Description | | --- | --- | | URL | Must start with `https://` (or `http://`). Templates are allowed, for example `https://example.com/hooks/{{ trigger.order_id }}`. | | Method | `GET`, `POST`, `PUT`, `PATCH` or `DELETE`. Defaults to `POST`. | | Headers | Key-value pairs, templates allowed. Use them to authenticate to your endpoint. | | Body | A JSON body, templates allowed. If you leave it empty, the step sends its input (the previous step's output or the trigger payload). | | Ignore errors | By default a response with status `400` or higher fails the step. Turn this on to continue anyway. | Requests time out after the step's timeout (at most two minutes). The step's output contains your endpoint's status code and response, so later steps can branch on it with a **Condition** step. ### Securing your endpoint [#securing-your-endpoint] Luso8 does not sign outbound requests yet. Protect your endpoint by checking a secret you choose: - add a header such as `Authorization: Bearer ` in the step's **Headers**, and reject requests without it, or - include a long random token in the URL path and verify it on your side. Always use HTTPS, and make your handler idempotent: a run can be retried, so the same event may arrive more than once. ## Related [#related] Triggers, steps and runs in the app. Webhook steps inside outreach sequences. Trigger workflows with an API key instead. Let AI tools run workflows for you. --- # Remote MCP server (/developers/mcp) > Connect Claude, ChatGPT, Cursor and other AI tools to your Luso8 workspace with the Model Context Protocol. > **Preview:** this feature is in preview. The contract is stable enough to build against, but details may change before general availability. The Luso8 MCP server lets AI assistants read and act on your workspace: look up contacts and deals, summarize conversations, draft campaign steps, create tickets, book meetings and run workflows. It speaks the [Model Context Protocol](https://modelcontextprotocol.io), so any MCP-compatible client can connect. | | | | --- | --- | | **Endpoint** | `https://mcp.luso8.rexplore.ai/mcp` | | **Transport** | Streamable HTTP | | **Authentication** | OAuth 2.1 with Rexplore ID (recommended), or a workspace API key as a bearer token | | **Scopes** | `luso8:read` (read-only) and `luso8:write` (read and write) | ## Authentication [#authentication] ### OAuth with Rexplore ID [#oauth-with-rexplore-id] Most clients only need the URL. On first use they discover the authorization server, register themselves with **dynamic client registration**, and open a browser window where you sign in with your [Rexplore ID](/rexplore-id) and approve access. The flow uses the authorization code grant with PKCE; tokens are refreshed automatically. - **Authorization server**: `https://auth.rexplore.ai` - **Scopes requested**: `luso8:read` to look things up, `luso8:write` to let the assistant make changes The assistant acts as you, in your active workspace, with your role's permissions. ### API key [#api-key] For clients that let you set request headers, or for automations without a person to sign in, send a [workspace API key](/developers/api-keys) as a bearer token: ```http Authorization: Bearer luso8_sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` The key's scopes still apply. A key with only `contacts:read` cannot create tickets through MCP. ## Connect a client [#connect-a-client] Works in Claude on the web and in Claude Desktop. 1. Open **Settings → Connectors** and choose **Add custom connector**. 2. Name it `Luso8` and paste the URL `https://mcp.luso8.rexplore.ai/mcp`. 3. Click **Connect**, sign in with your Rexplore ID and approve access. 4. In a chat, enable the Luso8 connector from the tools menu and ask, for example, "Which deals moved to Negotiation this week?" On Team and Enterprise plans an owner may need to add the connector for the organization first. ```bash claude mcp add --transport http luso8 https://mcp.luso8.rexplore.ai/mcp ``` Then run `/mcp` inside Claude Code and choose **Authenticate** to sign in with your Rexplore ID. To use an API key instead: ```bash claude mcp add --transport http luso8 https://mcp.luso8.rexplore.ai/mcp \ --header "Authorization: Bearer $LUSO8_API_KEY" ``` ChatGPT connects to remote MCP servers as custom connectors (apps). The exact menu names change between plans and releases; in general: 1. Open ChatGPT **Settings** and find **Connectors** (or **Apps**). Turn on developer mode if your plan requires it for custom connectors. 2. Create a new connector, name it `Luso8`, and enter the MCP server URL `https://mcp.luso8.rexplore.ai/mcp`. 3. Choose OAuth as the authentication method, then sign in with your Rexplore ID when prompted. 4. Enable the connector in a conversation and ask about your workspace. Add the server to `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` (one project): ```json title="~/.cursor/mcp.json" { "mcpServers": { "luso8": { "url": "https://mcp.luso8.rexplore.ai/mcp" } } } ``` Cursor opens a browser to sign in with your Rexplore ID. To use an API key instead: ```json title="~/.cursor/mcp.json" { "mcpServers": { "luso8": { "url": "https://mcp.luso8.rexplore.ai/mcp", "headers": { "Authorization": "Bearer luso8_sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" } } } } ``` Add the server to `.vscode/mcp.json` in your workspace, or run **MCP: Add Server** from the command palette and choose **HTTP**: ```json title=".vscode/mcp.json" { "servers": { "luso8": { "type": "http", "url": "https://mcp.luso8.rexplore.ai/mcp" } } } ``` VS Code prompts you to sign in with your Rexplore ID the first time a tool runs. Any client that supports Streamable HTTP MCP servers can connect. Point it at the URL and let it run the OAuth flow: ```json { "luso8": { "type": "http", "url": "https://mcp.luso8.rexplore.ai/mcp" } } ``` If the client cannot do OAuth, configure an `Authorization: Bearer ` header. Clients that only support stdio servers can use a bridge such as `mcp-remote`: ```bash npx -y mcp-remote https://mcp.luso8.rexplore.ai/mcp ``` ## Available tools [#available-tools] Tools are grouped by area. Read tools need `luso8:read` (or the matching `:read` API key scope); tools that change data need `luso8:write`. | Area | What the assistant can do | | --- | --- | | Contacts and companies | Search, get, create and update contacts and companies; search across your CRM with filters | | Lists | Read lists and their members, create and update lists, add or remove contacts | | Deals | Search deals, leads and prospects, get and update deals, create leads, summarize the pipeline, look up products | | Campaigns | Read campaigns and analytics, create or generate a campaign, add and edit steps and conditions, enroll contacts, launch, pause or resume, send a campaign email to one contact | | Inbox | List conversations and messages, see inbox stats, send a message, escalate a conversation to a human | | Calls | Read call logs and call performance, list and schedule calls | | Appointments | Search appointments, book meetings, update an appointment's status | | Tickets | Search, get, create, update and close tickets, add comments | | Payments | Create a payment link, check a payment's status, list supported payment channels | | Workflows | List and run workflows, create a workflow from an example or generate one from a description | | Knowledge and help | Search your knowledge base and help center articles | | Reports and team | Dashboard stats, report overview, recent activity, team members and AI agents | ### Confirmation before changes [#confirmation-before-changes] Every tool that creates, changes, sends, schedules or charges something supports a `confirm` parameter. Called without confirmation, the tool returns a preview of exactly what it will do, and the assistant shows it to you. Nothing happens until you approve and the assistant calls the tool again with `confirm: true`. Most clients also ask you before running any tool. ## Example prompts [#example-prompts] - "Find contacts at fintech companies in Kenya that we haven't emailed, and add them to a new list called Q1 Nairobi." - "Summarize the last five conversations in the inbox that are still open, and draft replies." - "Create a ticket for Acme Ltd about the failed payment and assign it high priority." - "Book a 30-minute call with Ada Lovelace next Tuesday afternoon." - "How did the Onboarding nurture campaign perform last month?" ## Security [#security] - **Least privilege.** Grant `luso8:read` unless you want the assistant to make changes. With API keys, choose narrow scopes. - **Review before approving.** Read the preview for write actions, especially messages to customers and payment links. - **Revoke access** at any time: disconnect the connector in your client, sign out the session in your [Rexplore ID account](/rexplore-id/account), or revoke the API key in **Settings → Developers → API keys**. - **Data stays in your workspace.** The MCP server only reads and writes the workspace you are signed in to. What your AI client does with the results is governed by that client's own terms and data settings. ## Troubleshooting [#troubleshooting] Make sure the URL ends with `/mcp` and the client supports remote (Streamable HTTP) servers with OAuth. Older clients may need an API key header or the `mcp-remote` bridge. The connection was approved with `luso8:read` only, or the API key lacks the scope for that area. Reconnect and approve write access, or create a key with the needed scope. OAuth connections use your active workspace. Switch workspaces in Luso8, then reconnect. API keys always use the workspace that created them. --- # Sync contacts from your app (/developers/guides/sync-contacts) > Keep Luso8 contacts up to date from your product's signups, with upserts, bulk imports and list enrollment. > **Preview:** this feature is in preview. The contract is stable enough to build against, but details may change before general availability. This guide shows how to push people from your own product into Luso8 as they sign up or change their details, and how to add them to a list that a [campaign](/luso8/campaigns) can use. You will build an idempotent **upsert**: find the contact by email, update it if it exists, create it if it does not. ## What you need [#what-you-need] - A Luso8 workspace where you are an Owner or Administrator. - An [API key](/developers/api-keys) with the `contacts:write` and `lists:write` scopes. - The ID of the list you want new signups in. Open the list in **Data → Lists** and copy the ID from the URL, or call `GET /api/v1/lists`. Store the key as `LUSO8_API_KEY` in your server environment. Never send it to the browser. ## 1. Find a contact by email [#1-find-a-contact-by-email] `GET /api/v1/contacts?search={email}` `search` matches names, emails and phone numbers, so filter the results for an exact email match: ```js tab="Node.js" const BASE = 'https://api.luso8.rexplore.ai/api/v1'; const headers = { Authorization: `Bearer ${process.env.LUSO8_API_KEY}`, 'Content-Type': 'application/json', }; async function findContactByEmail(email) { const url = new URL(`${BASE}/contacts`); url.searchParams.set('search', email); url.searchParams.set('limit', '10'); const res = await fetch(url, { headers }); if (!res.ok) throw new Error(`Search failed: ${res.status} ${await res.text()}`); const contacts = await res.json(); return contacts.find((c) => c.email?.toLowerCase() === email.toLowerCase()) ?? null; } ``` ```python tab="Python" import os import requests BASE = "https://api.luso8.rexplore.ai/api/v1" session = requests.Session() session.headers["Authorization"] = f"Bearer {os.environ['LUSO8_API_KEY']}" def find_contact_by_email(email: str) -> dict | None: res = session.get(f"{BASE}/contacts", params={"search": email, "limit": 10}, timeout=30) res.raise_for_status() for contact in res.json(): if (contact.get("email") or "").lower() == email.lower(): return contact return None ``` ## 2. Create or update it [#2-create-or-update-it] `POST /api/v1/contacts` `PUT /api/v1/contacts/{contact_id}` Map your user fields to Luso8 contact fields. All fields are optional; send the ones you have. `PUT` only changes the fields you send. | Luso8 field | Example | | --- | --- | | `email` | `ada@example.com` | | `first_name`, `last_name` | `Ada`, `Lovelace` | | `phone`, `mobile_phone` | `+265991234567` (E.164 recommended) | | `company_name` | `Analytical Engines Ltd` | | `job_title` | `Head of Operations` | | `country`, `town` | `Malawi`, `Lilongwe` | | `source` | `website-signup` | | `notes` | Free text | ```js tab="Node.js" async function upsertContact(user) { const body = { email: user.email, first_name: user.firstName, last_name: user.lastName, phone: user.phone, company_name: user.company, job_title: user.jobTitle, country: user.country, source: 'website-signup', }; const existing = await findContactByEmail(user.email); const res = existing ? await fetch(`${BASE}/contacts/${existing.id}`, { method: 'PUT', headers, body: JSON.stringify(body) }) : await fetch(`${BASE}/contacts`, { method: 'POST', headers, body: JSON.stringify(body) }); if (!res.ok) throw new Error(`Upsert failed: ${res.status} ${await res.text()}`); return res.json(); // the saved contact, including its id } ``` ```python tab="Python" def upsert_contact(user: dict) -> dict: body = { "email": user["email"], "first_name": user.get("first_name"), "last_name": user.get("last_name"), "phone": user.get("phone"), "company_name": user.get("company"), "job_title": user.get("job_title"), "country": user.get("country"), "source": "website-signup", } body = {k: v for k, v in body.items() if v is not None} existing = find_contact_by_email(user["email"]) if existing: res = session.put(f"{BASE}/contacts/{existing['id']}", json=body, timeout=30) else: res = session.post(f"{BASE}/contacts", json=body, timeout=30) res.raise_for_status() return res.json() ``` ## 3. Add the contact to a list [#3-add-the-contact-to-a-list] `POST /api/v1/lists/{list_id}/contacts` The body takes one or more contact IDs. Contacts already in the list are left as they are. ```js tab="Node.js" async function addToList(listId, contactIds) { const res = await fetch(`${BASE}/lists/${listId}/contacts`, { method: 'POST', headers, body: JSON.stringify({ contact_ids: contactIds }), }); if (!res.ok) throw new Error(`Add to list failed: ${res.status} ${await res.text()}`); return res.json(); } // In your signup handler: const contact = await upsertContact(user); await addToList(process.env.LUSO8_SIGNUPS_LIST_ID, [contact.id]); ``` ```python tab="Python" def add_to_list(list_id: str, contact_ids: list[str]) -> dict: res = session.post(f"{BASE}/lists/{list_id}/contacts", json={"contact_ids": contact_ids}, timeout=30) res.raise_for_status() return res.json() # In your signup handler: contact = upsert_contact(user) add_to_list(os.environ["LUSO8_SIGNUPS_LIST_ID"], [contact["id"]]) ``` If a campaign is enrolling that list, new members can be added to the campaign from the campaign's **Contacts** tab, or with `POST /api/v1/campaigns/{campaign_id}/contacts/from-lists` (scope `campaigns:write`). ## 4. Backfill existing users in bulk [#4-backfill-existing-users-in-bulk] `POST /api/v1/contacts/bulk` For a first import, send batches of contacts in one request instead of one call per user. The body is an array of the same contact objects you send to `POST /api/v1/contacts`. ```js tab="Node.js" async function backfill(users, batchSize = 200) { for (let i = 0; i < users.length; i += batchSize) { const batch = users.slice(i, i + batchSize).map((u) => ({ email: u.email, first_name: u.firstName, last_name: u.lastName, company_name: u.company, source: 'backfill', })); const res = await fetch(`${BASE}/contacts/bulk`, { method: 'POST', headers, body: JSON.stringify(batch) }); if (!res.ok) throw new Error(`Batch ${i / batchSize} failed: ${res.status} ${await res.text()}`); } } ``` ```python tab="Python" def backfill(users: list[dict], batch_size: int = 200) -> None: for i in range(0, len(users), batch_size): batch = [ { "email": u["email"], "first_name": u.get("first_name"), "last_name": u.get("last_name"), "company_name": u.get("company"), "source": "backfill", } for u in users[i : i + batch_size] ] res = session.post(f"{BASE}/contacts/bulk", json=batch, timeout=120) res.raise_for_status() ``` Run the backfill before you switch on real-time sync, and use upserts from then on so repeated events never create duplicates. ## 5. Handle rate limits and failures [#5-handle-rate-limits-and-failures] Each key can make 600 requests per minute. A signup handler makes two or three calls per user, which is plenty for most products, but backfills and bursts can hit the limit: - On `429`, wait for the `Retry-After` header and retry. See [Rate limits](/developers/rate-limits) for a ready-made helper. - On `5xx` or network errors, retry with exponential backoff. The upsert is safe to repeat. - On `422`, log the `detail` array: it names the invalid field. See [Errors](/developers/errors). - Don't block your own signup on Luso8. Run the sync in a background job or queue, so a slow request never delays your user. ## Next steps [#next-steps] All contact, list and campaign endpoints. Start a Luso8 workflow when a user signs up. Custom fields, enrichment and filters. Turn your list into an outreach sequence. --- # Rexplore ID (/rexplore-id) > One account for Luso8 and every other Rexplore product, at auth.rexplore.ai. Rexplore ID is the account you use to sign in to Rexplore products: Luso8 on the web, the Luso8 mobile app, and the apps that follow. You create it once, and the same email, password, Google sign-in and two-step verification work everywhere. Rexplore ID lives at [auth.rexplore.ai](https://auth.rexplore.ai). When you sign in to an app, you are sent there, you sign in, and you are sent back. Apps never see your password. ## What you can do [#what-you-can-do] | Task | Where | | --- | --- | | Create an account, sign in, reset your password | [Signing in](/rexplore-id/sign-in) | | Change your name, photo or email, connect Google | [Your account](/rexplore-id/account) | | Protect your account with an authenticator app | [Two-step verification](/rexplore-id/two-step-verification) | | See where you're signed in and sign out other devices | [Your account](/rexplore-id/account#active-sessions) | | Let users of your app sign in with Rexplore ID | [For developers](/rexplore-id/developers) | ## How it relates to your workspace [#how-it-relates-to-your-workspace] Your Rexplore ID is **you**. Your Luso8 workspace (organization) is **your team's data**. One Rexplore ID can belong to several workspaces, and each workspace decides your role in it. Invitations, roles and billing are managed in Luso8 under [Settings](/luso8/settings), not in Rexplore ID. ## Security at a glance [#security-at-a-glance] - Passwords are at least 12 characters and checked against known breached-password lists. - Repeated wrong passwords lock sign-in for 15 minutes, and the account owner is emailed. - Two-step verification with an authenticator app and backup codes. - Short-lived tokens for apps, with refresh tokens that rotate on every use. - A list of active sessions you can sign out of at any time. Read more in [Security and privacy](/luso8/security). --- # Signing in (/rexplore-id/sign-in) > Create a Rexplore ID, sign in with email or Google, and recover access if you forget your password. You sign in to every Rexplore app with your Rexplore ID at [auth.rexplore.ai](https://auth.rexplore.ai). When you open an app such as Luso8 and you aren't signed in, it sends you to Rexplore ID and brings you back once you're done. ## Create an account [#create-an-account] ### Open the sign-up page [#open-the-sign-up-page] Choose **Create account** on the sign-in screen, or follow the link in an invitation email. ### Enter your details [#enter-your-details] Enter your name, your work email and a password, and accept the Terms. Your password must: - be at least **12 characters** long, and - not appear in known lists of breached passwords. A passphrase of a few unrelated words is easy to remember and hard to guess. ### Verify your email [#verify-your-email] We email you a **6-digit code**. Enter it to confirm the address. If it doesn't arrive, check your spam folder; you can request a new code after 60 seconds. Prefer not to manage another password? Choose **Continue with Google** instead. You can add a password later from [your account](/rexplore-id/account). ## Sign in [#sign-in] Enter your email and password, or choose **Continue with Google**. - **Keep me signed in** keeps you signed in on this device for up to 30 days. Leave it off on shared computers: you'll be signed out when the browser closes. - If you've turned on [two-step verification](/rexplore-id/two-step-verification), you'll be asked for a code from your authenticator app next. ### Signing in to an app [#signing-in-to-an-app] Apps can show their own name, logo and colors on the sign-in page. You'll see **Secured by Rexplore ID** under the form: it's the same Rexplore ID account and the same password, just presented in that app's style. Before you enter your password, check that the address bar shows `auth.rexplore.ai`. ## Forgot your password [#forgot-your-password] ### Request a reset link [#request-a-reset-link] Choose **Forgot password** on the sign-in screen and enter your email. For your privacy, you'll see the same message whether or not an account exists for that address. ### Choose a new password [#choose-a-new-password] Open the link in the email and choose a new password. The link is valid for **30 minutes** and can be used **once**. Resetting your password signs you out of every other device, so anyone who knew the old password loses access. ## Too many attempts [#too-many-attempts] After **5 wrong passwords within 15 minutes**, sign-in to that account is locked for **15 minutes**, and we email the account owner. If that email surprises you, reset your password and turn on two-step verification. ## Accounts created for you [#accounts-created-for-you] If an administrator created your account, you'll get an email with a link to set your password. The link is valid for 72 hours. If it expires, use **Forgot password** to get a new one. ## Troubleshooting [#troubleshooting] Check your spam or promotions folder and wait a minute. Make sure you typed the address you signed up with. You can request another verification code after 60 seconds. You already have a Rexplore ID with that email, possibly created with Google. Sign in instead, or use Forgot password to set a password. That password has appeared in a public data breach, so attackers try it first. Choose a different one, ideally a passphrase or one from a password manager. Use one of your backup codes. See [Two-step verification](/rexplore-id/two-step-verification#lost-your-device). --- # Your account (/rexplore-id/account) > Manage your profile, email, sign-in methods and active sessions on your Rexplore ID account page. Everything about your Rexplore ID is on one page: [auth.rexplore.ai/account](https://auth.rexplore.ai/account). In Luso8, **Settings → Account → Profile** links there for security settings. Changes apply to every Rexplore app you use. ## Profile [#profile] - **Name**: shown to your teammates in every app. - **Photo**: upload a PNG, JPG, WebP or GIF image of up to **5 MB**, or remove it. It appears next to your name in Luso8 and other apps. ## Email [#email] Your email is where we send verification codes, password resets and security alerts. A **Verified** badge shows it's confirmed. To change it, choose **Change email**, enter the new address and confirm it with the code we send there. Until you confirm, your old address stays active. ## Sign-in methods [#sign-in-methods] | Method | What you can do | | --- | --- | | **Password** | Change it, or add one if you signed up with Google. Changing your password requires your current one. | | **Google** | Connect your Google account to sign in with one click, or disconnect it. To disconnect Google you need a password, so you can still sign in. | ## Two-step verification [#two-step-verification] Turn on **Two-step sign-in** to add an authenticator app as a second step when you sign in, and download backup codes. See [Two-step verification](/rexplore-id/two-step-verification). ## Active sessions [#active-sessions] The sessions list shows every browser and device where you're signed in, with its approximate location. The one you're using is marked **This device**. - Sign out a single session you don't recognize. - Choose **Sign out everywhere else** to end every session except this one, for example after losing a phone or using a shared computer. Sign it out, change your password, choose **Sign out everywhere else**, and turn on two-step verification. ## Signing out [#signing-out] Signing out of an app such as Luso8 also ends your Rexplore ID session in that browser, so the next app you open asks you to sign in again. --- # Two-step verification (/rexplore-id/two-step-verification) > Protect your Rexplore ID with a code from an authenticator app, and keep backup codes for when you lose your phone. Two-step verification (shown as **Two-step sign-in** on your account page) adds a second check when you sign in: after your password, you enter a 6-digit code from an authenticator app on your phone. Someone who learns your password still can't get in without your phone. It works with any authenticator app that supports time-based codes (TOTP), such as Google Authenticator, Microsoft Authenticator, 1Password, Bitwarden or Authy. ## Turn it on [#turn-it-on] ### Open your account [#open-your-account] Go to [auth.rexplore.ai/account](https://auth.rexplore.ai/account), find **Two-step sign-in** and choose **Turn on**. If your account has a password, you'll be asked for it. ### Scan the QR code [#scan-the-qr-code] Open your authenticator app, add an account, and scan the QR code. Can't scan it? Type the key shown next to the code instead. ### Enter a code [#enter-a-code] Type the 6-digit code your app shows to confirm it's working. ### Save your backup codes [#save-your-backup-codes] You'll get **10 backup codes**. Each one lets you sign in once, in place of an app code. Copy or download them and store them somewhere safe and separate from your phone, such as a password manager. They are shown only once. ## Signing in with two-step verification [#signing-in-with-two-step-verification] After your email and password (or Google), enter the current code from your authenticator app. Codes change every 30 seconds; if one is rejected, wait for the next. No phone? Choose **Use a backup code** and enter one of your saved codes. That code can't be used again. ## Get new backup codes [#get-new-backup-codes] Backup codes are created when you turn two-step verification on. To get a fresh set (for example, after using several), turn two-step verification off and on again. You'll scan a new QR code and receive 10 new backup codes; the old codes and the old authenticator entry stop working. ## Turn it off [#turn-it-off] On your account page, choose **Turn off** under Two-step sign-in and confirm with your password. We recommend keeping it on, especially for workspace Owners and Administrators. ## Lost your device [#lost-your-device] - **You have backup codes**: sign in with one, turn two-step verification off and on again with your new phone, and save the new backup codes. - **You moved to a new phone**: many authenticator apps can transfer accounts or back them up. Otherwise, sign in with a backup code and set up again. - **You have neither**: email [hello@rexplore.ai](mailto:hello@rexplore.ai) from the address on your account. We'll verify that the account is yours before removing two-step verification, which can take some time. Two-step verification is set per person. Workspaces can't yet require it for all members, so encourage your team to turn it on. --- # Rexplore ID for developers (/rexplore-id/developers) > Let people sign in to your app with Rexplore ID, a standard OpenID Connect provider with PKCE, rotating refresh tokens and a public JWKS. Rexplore ID is an **OpenID Connect** provider. Any OIDC or OAuth 2.0 client library can use it: your app redirects the browser to Rexplore ID, the user signs in, and your app exchanges the returned code for tokens. Your app never handles passwords. ## Discovery [#discovery] | | | | --- | --- | | **Issuer** | `https://auth.rexplore.ai` | | **OpenID configuration** | `https://auth.rexplore.ai/.well-known/openid-configuration` | | **OAuth server metadata** | `https://auth.rexplore.ai/.well-known/oauth-authorization-server` | | **JWKS** | `https://auth.rexplore.ai/.well-known/jwks.json` (also at `/api/auth/jwks`) | Configure your library with the issuer and let it read the discovery document; the endpoints below are listed for reference. ## Endpoints [#endpoints] | Endpoint | URL | | --- | --- | | Authorization | `https://auth.rexplore.ai/api/auth/oauth2/authorize` | | Token | `https://auth.rexplore.ai/api/auth/oauth2/token` | | UserInfo | `https://auth.rexplore.ai/api/auth/oauth2/userinfo` | | Revocation | `https://auth.rexplore.ai/api/auth/oauth2/revoke` | | Introspection | `https://auth.rexplore.ai/api/auth/oauth2/introspect` | | End session (logout) | `https://auth.rexplore.ai/api/auth/oauth2/end-session` | ## Scopes [#scopes] | Scope | Grants | | --- | --- | | `openid` | Required. Returns an ID token with the user's `sub`. | | `profile` | `name` and `picture` in the ID token and UserInfo | | `email` | `email` and `email_verified` | | `offline_access` | A refresh token, so your app can stay signed in | ## The authorization code flow [#the-authorization-code-flow] Rexplore ID supports the **authorization code** grant with **PKCE** (`code_challenge_method=S256`). PKCE is required for public clients (mobile apps and single-page apps) and recommended for every client. ```mermaid sequenceDiagram participant U as User participant A as Your app participant R as Rexplore ID U->>A: Click Sign in A->>R: Redirect to /authorize (client_id, redirect_uri, scope, state, code_challenge) R->>U: Sign in (password or Google, plus two-step if on) R->>A: Redirect to redirect_uri with code and state A->>R: POST /token (code, code_verifier) R->>A: access_token, id_token, refresh_token A->>U: Signed in ``` ### 1. Redirect to Rexplore ID [#1-redirect-to-rexplore-id] ```text https://auth.rexplore.ai/api/auth/oauth2/authorize ?response_type=code &client_id=YOUR_CLIENT_ID &redirect_uri=https%3A%2F%2Fapp.example.com%2Fcallback &scope=openid%20profile%20email%20offline_access &state=RANDOM_STATE &code_challenge=BASE64URL_SHA256_OF_VERIFIER &code_challenge_method=S256 ``` Optional parameters: | Parameter | Effect | | --- | --- | | `login_hint=ada@example.com` | Pre-fills the email field | | `prompt=create` or `screen=sign-up` | Opens **Create account** instead of sign-in | ### 2. Exchange the code [#2-exchange-the-code] ```bash curl -X POST https://auth.rexplore.ai/api/auth/oauth2/token \ -H "Content-Type: application/x-www-form-urlencoded" \ -d grant_type=authorization_code \ -d code=AUTHORIZATION_CODE \ -d redirect_uri=https://app.example.com/callback \ -d client_id=YOUR_CLIENT_ID \ -d code_verifier=ORIGINAL_CODE_VERIFIER ``` Confidential (server-side) clients also authenticate with their client secret. ### 3. Refresh [#3-refresh] ```bash curl -X POST https://auth.rexplore.ai/api/auth/oauth2/token \ -H "Content-Type: application/x-www-form-urlencoded" \ -d grant_type=refresh_token \ -d refresh_token=REFRESH_TOKEN \ -d client_id=YOUR_CLIENT_ID ``` Store the new refresh token from every response: refresh tokens **rotate on each use**. ## Tokens [#tokens] | Token | Format | Lifetime | | --- | --- | --- | | Access token | JWT signed with RS256 | 10 minutes | | ID token | JWT signed with RS256 | 10 minutes | | Refresh token | Opaque | 30 days, rotated on every use | Reusing a refresh token that has already been exchanged revokes the whole token family (after a short grace period for retries), and the user has to sign in again. This protects against stolen refresh tokens. Access tokens carry `iss` (`https://auth.rexplore.ai`), `aud` (the API the token is for), `sub`, `email`, `name`, `email_verified` and `sid`. There is no organization claim: workspace membership is resolved by each product. ### The `sub` claim [#the-sub-claim] `sub` is the stable user ID. New accounts look like `rx|3f1c9a2e-...`. Accounts that existed before Rexplore ID launched keep their earlier identifier (for example `google-oauth2|...`). Treat `sub` as an opaque string and never parse it. ## Verify access tokens [#verify-access-tokens] APIs that accept Rexplore ID access tokens verify them locally with the public JWKS: check the signature, `iss`, `aud` and expiry. ```ts tab="Node.js (jose)" import { createRemoteJWKSet, jwtVerify } from 'jose'; const JWKS = createRemoteJWKSet(new URL('https://auth.rexplore.ai/.well-known/jwks.json')); export async function verifyAccessToken(token: string) { const { payload } = await jwtVerify(token, JWKS, { issuer: 'https://auth.rexplore.ai', audience: 'YOUR_API_AUDIENCE', algorithms: ['RS256'], }); return payload; // payload.sub, payload.email, ... } ``` ```python tab="Python (PyJWT)" import jwt jwks_client = jwt.PyJWKClient("https://auth.rexplore.ai/.well-known/jwks.json") def verify_access_token(token: str) -> dict: signing_key = jwks_client.get_signing_key_from_jwt(token) return jwt.decode( token, signing_key.key, algorithms=["RS256"], issuer="https://auth.rexplore.ai", audience="YOUR_API_AUDIENCE", ) ``` ### Key rotation [#key-rotation] Signing keys rotate every 90 days. The previous key stays in the JWKS for 30 days after rotation, so tokens signed just before a rotation keep verifying. Pick the key by the token's `kid` header, cache the JWKS, and refetch it when you see an unknown `kid`. Both libraries above do this for you. ## Register an app [#register-an-app] Apps are registered by Rexplore. Email [hello@rexplore.ai](mailto:hello@rexplore.ai) with: | Detail | Notes | | --- | --- | | App name, logo and home URL | Shown on the sign-in and consent screens | | App type | **Web app**: a confidential client with a client secret, for server-rendered apps and backends. **Mobile or single-page app**: a public client without a secret that must use PKCE. | | Redirect URIs | Exact URLs Rexplore ID may redirect to after sign-in. Must use `https://`, except `http://localhost` for development. | | Post-logout redirect URIs | Where to send users after they sign out | | APIs | Which APIs your app needs access tokens for | You'll receive a client ID (and, for web apps, a client secret shown once). ### Branded sign-in pages [#branded-sign-in-pages] Registered apps can have their own sign-in look: name, logo, colors and a short story column, with **Secured by Rexplore ID** under the form. Each app gets direct links: ```text https://auth.rexplore.ai/sign-in/ https://auth.rexplore.ai/sign-up/ ``` Users still sign in with the same Rexplore ID. ### MCP clients [#mcp-clients] AI tools connecting to the [Luso8 MCP server](/developers/mcp) don't need manual registration: they register themselves with OAuth **dynamic client registration** and use the same authorization code and PKCE flow. ## Sign out [#sign-out] To sign the user out of Rexplore ID as well as your app, redirect to the end-session endpoint with the ID token and one of your registered post-logout URIs: ```text https://auth.rexplore.ai/api/auth/oauth2/end-session ?id_token_hint=ID_TOKEN &post_logout_redirect_uri=https%3A%2F%2Fapp.example.com%2F ``` ## Not yet available [#not-yet-available] Passkeys, enterprise SSO (SAML) and organization-enforced two-step verification are not available yet. --- # Voxtra (/voxtra) > Voxtra is open voice infrastructure for AI agents — a Python framework that bridges Asterisk telephony with AI voice agents through a developer-friendly API. Ten lines to a working call handler. **Voxtra** is open voice infrastructure for AI agents. It bridges Asterisk telephony with AI voice agents through a clean, batteries-included Python API — ten lines to a working call handler. ```python title="hello.py" from voxtra import VoxtraApp app = VoxtraApp( ari_url="http://pbx.example.com:8088", ari_user="asterisk", ari_password="secret", ) @app.default() async def handle(call): await call.answer() await call.play_file("hello-world") await call.hangup() app.run() ``` That's it. Voxtra owns the ARI connection, dispatches Stasis events, and hands you a high-level [`CallSession`](/voxtra/reference/call-session) for every inbound call. ## Why Voxtra exists [#why-voxtra-exists] Building voice AI on Asterisk usually means writing a lot of boilerplate: managing the ARI WebSocket, parsing Stasis events, juggling AudioSocket frames, plumbing TTS/STT/LLM together, and hardening it all for production. Voxtra collapses that surface area into four primitives: - A **[`VoxtraApp`](/voxtra/reference/voxtra-app)** for the application lifecycle. - A **[`CallSession`](/voxtra/reference/call-session)** for everything you do to a call (`answer`, `say`, `listen`, `record_start`, `bridge_with`, …). - A **[`Router`](/voxtra/concepts/routing)** that maps inbound DIDs and extensions to async handlers. - A **[`VoicePipeline`](/voxtra/guides/ai-voice-agent)** that chains STT → LLM → TTS with built-in barge-in detection. Everything else — webhooks, recording sinks, multi-tenant provisioning, SIP-aware idle detection — is layered on top of these four. ## Pick a path [#pick-a-path] ## What's in the box [#whats-in-the-box] - **Asterisk-native.** Built directly on ARI. No abstraction layer hiding the PBX. You can drop down to raw `voxtra.ARIClient` whenever you need to. - **AudioSocket-first.** Clean TCP audio I/O. No RTP/SRTP complexity in your application code. - **Provider registry.** STT, TTS, LLM, VAD, and telephony providers self-register via decorators — third-party packages slot in without touching the core. - **SaaS-ready.** Per-tenant Stasis app namespacing ([`TenantProvisioner`](/voxtra/reference/provisioning)) lets one Asterisk cluster host hundreds of isolated Voxtra apps. - **Webhook integration.** Every event optionally fans out to your backend via signed HTTP POSTs ([`BackendWebhook`](/voxtra/reference/webhooks)). - **Pluggable recording.** Drop in a [`RecordingSink`](/voxtra/reference/recording) to push call recordings to GCS, S3, or your own pipeline. ## Production users [#production-users] Voxtra powers the Luso8 Cloud call center — every outbound dialer call, inbound trunk hit, and AI-handled support conversation goes through it. The library is ~3,500 lines, has 200+ tests, and is published to PyPI as [`voxtra`](https://pypi.org/project/voxtra/). ## Status [#status] Pre-1.0 but production-ready for the documented surface. Track the [changelog](https://github.com/rexplore-ai/voxtra/blob/main/CHANGELOG.md) for breaking-change notes between minor versions. --- # Getting Started (/voxtra/getting-started) > Install Voxtra, point it at an Asterisk PBX, and place your first call. This page walks through installing Voxtra, wiring it to a running Asterisk PBX, and placing your first inbound and outbound calls. By the end you'll have a working `VoxtraApp` that picks up calls and runs your handler. ## Prerequisites [#prerequisites] You'll need: - **Python 3.11+**. - **Asterisk 18+** with ARI enabled (`asterisk-ari`) and an HTTP/WebSocket endpoint reachable from your Voxtra process. - An **ARI user** with permission to control Stasis applications. - For the AI-agent path: API keys for your STT, LLM, and TTS providers (Deepgram, OpenAI, ElevenLabs are first-class; others register via the [provider registry](/voxtra/concepts/architecture)). No Asterisk yet? Try the [`docker-compose` example](https://github.com/rexplore-ai/voxtra/tree/main/examples) in the Voxtra repo for a complete local stack. ## Install [#install] ```bash pip install voxtra ``` ```bash poetry add voxtra ``` ```bash uv add voxtra ``` Optional extras enable individual provider integrations: ```bash pip install "voxtra[deepgram,openai,elevenlabs]" # AI providers pip install "voxtra[provisioning]" # Multi-tenant config pip install "voxtra[all]" # Everything ``` ## Hello, call [#hello-call] The smallest possible Voxtra app: ```python title="hello.py" from voxtra import VoxtraApp app = VoxtraApp( ari_url="http://pbx.example.com:8088", ari_user="asterisk", ari_password="secret", ) @app.default() async def handle(call): await call.answer() await call.play_file("hello-world") await call.hangup() app.run() ``` Run it: ```bash python hello.py ``` Voxtra connects to ARI, subscribes to Stasis events for the default app name (`voxtra`), and waits. Call any number routed to the `Stasis(voxtra)` app from your dialplan and the handler fires. ## Configure your Asterisk dialplan [#configure-your-asterisk-dialplan] Voxtra needs incoming calls handed off to its Stasis app. Add this to `extensions.conf` (or wherever your inbound trunk routes to): ```ini title="/etc/asterisk/extensions.conf" [from-trunk] exten => _X.,1,NoOp(Inbound to Voxtra) same => n,Stasis(voxtra) same => n,Hangup() ``` Reload the dialplan: ```bash asterisk -rx "dialplan reload" ``` Now any inbound call entering `from-trunk` lands in your `@app.default()` handler. Need per-tenant isolation? See [Multi-tenant provisioning](/voxtra/guides/multi-tenant) — `TenantProvisioner` generates the dialplan, ARI user, and PJSIP fragments automatically. ## Add routing [#add-routing] Static-route handlers respond to specific extensions or numbers: ```python {7-13} from voxtra import VoxtraApp app = VoxtraApp(ari_url="...", ari_user="...", ari_password="...") @app.route(extension="1000") async def support(call): await call.answer() await call.play_file("support-greeting") await call.hangup() @app.route(extension="2000") async def sales(call): await call.answer() await call.play_file("sales-greeting") await call.hangup() @app.default() async def fallback(call): await call.answer() await call.play_file("vm-nobodyavail") await call.hangup() app.run() ``` See [Routing](/voxtra/concepts/routing) for number patterns, metadata, and dispatch rules. ## Place an outbound call [#place-an-outbound-call] `VoxtraApp.originate` returns the same `CallSession` your inbound handler gets, but for a call you initiate: ```python import asyncio from voxtra import VoxtraApp app = VoxtraApp(ari_url="...", ari_user="...", ari_password="...") async def call_alice(): await app.start() call = await app.originate( endpoint="PJSIP/+265999123456@my-trunk", caller_id="+265888000001", ) # Wait for the call to connect, then play a recorded message. await call.answer() await call.play_file("important-message") await call.hangup() await app.stop() asyncio.run(call_alice()) ``` For dialplan-routed origination (when you want the call to enter your existing dialplan instead of going straight to Stasis), use the lower-level [`ARIClient.originate`](/voxtra/reference/ari-client#originate) with `context=` and `extension=`. ## Add an AI voice agent [#add-an-ai-voice-agent] Pass STT, LLM, and TTS to `VoxtraApp` and Voxtra auto-wires a [`VoicePipeline`](/voxtra/guides/ai-voice-agent) into every session: ```python from voxtra import VoxtraApp from voxtra.ai.stt.deepgram import DeepgramSTT from voxtra.ai.tts.elevenlabs import ElevenLabsTTS from voxtra.ai.llm.openai import OpenAIAgent app = VoxtraApp( ari_url="http://pbx:8088", ari_user="asterisk", ari_password="secret", stt=DeepgramSTT(api_key="..."), tts=ElevenLabsTTS(api_key="...", voice_id="..."), llm=OpenAIAgent(api_key="...", system_prompt="You are a helpful agent."), ) @app.default() async def handle(call): await call.answer() await call.say("Hi! How can I help?") while True: user = await call.listen(timeout=10) if not user: break reply = await call.agent.respond(user.text) await call.say(reply.text) await call.hangup() app.run() ``` The full guide — including barge-in handling, tool calls, and per-session context — is at [AI voice agent](/voxtra/guides/ai-voice-agent). ## Where to go next [#where-to-go-next] ### Read the [architecture overview](/voxtra/concepts/architecture) [#read-the-architecture-overview] Understand how ARI events flow into your handler and back out as audio. ### Subscribe your backend with [webhooks](/voxtra/guides/webhooks) [#subscribe-your-backend-with-webhooks] `BackendWebhook` POSTs every call event to your service so CRM, billing, and analytics stay in sync. ### Plug in [recording](/voxtra/guides/recording) [#plug-in-recording] Drop in a `RecordingSink` to upload finished calls to GCS, S3, or your own storage. ### Browse the [examples gallery](/voxtra/examples) [#browse-the-examples-gallery] Working applications: IVR menu, sales bot, support bot, multi-tenant SaaS. --- # Architecture (/voxtra/concepts/architecture) > How VoxtraApp, ARIClient, AudioSocket, and the voice pipeline fit together to turn a SIP call into an async Python function call. Voxtra is built on four primitives. Once you understand how they compose, the rest of the API is mechanical. ## The big picture [#the-big-picture] ```mermaid flowchart TD Caller["📞 Caller / SIP trunk"] Asterisk["Asterisk PBX
• PJSIP transport
• Dialplan / Stasis app
• AudioSocket dialplan app"] ARIClient["ARIClient
• HTTP control
• WS event stream"] AudioSocket["AudioSocketServer
• TCP accept loop
• 4-byte framing"] VoxtraApp["VoxtraApp
• Translates ARI events → VoxtraEvents
• Owns the Router (dispatch by ext/number)
• Creates a CallSession per call
• Auto-wires VoicePipeline (if configured)
• Fires BackendWebhook (if configured)"] Handler["Your @app.route()
async def handler:
  call.answer()
  call.say(...)
  call.listen(...)"] Caller -->|SIP| Asterisk Asterisk -->|"ARI
(HTTP + WS)"| ARIClient Asterisk -->|"AudioSocket TCP
(μ-law / PCM frames)"| AudioSocket ARIClient --> VoxtraApp AudioSocket --> VoxtraApp VoxtraApp --> Handler classDef external fill:#e0f2fe,stroke:#0369a1,color:#0c4a6e classDef pbx fill:#fef3c7,stroke:#b45309,color:#78350f classDef voxtra fill:#ede9fe,stroke:#5b21b6,color:#2e1065 classDef user fill:#dcfce7,stroke:#166534,color:#14532d class Caller external class Asterisk pbx class ARIClient,AudioSocket,VoxtraApp voxtra class Handler user ``` ## The four primitives [#the-four-primitives] ### 1. `ARIClient` [#1-ariclient] The lowest layer. Wraps Asterisk's REST Interface (HTTP) and Stasis event stream (WebSocket). Methods are 1:1 with ARI endpoints — `originate`, `answer_channel`, `hangup_channel`, `create_bridge`, `record_channel`, `reload_module`, etc. You rarely use this directly, but it's there when you need to hit ARI features Voxtra hasn't wrapped yet: ```python from voxtra import ARIClient ari = ARIClient(base_url="http://pbx:8088", username="...", password="...") await ari.connect() modules = await ari.list_modules() # raw ARI call await ari.reload_module("res_pjsip.so") ``` [Reference →](/voxtra/reference/ari-client) ### 2. `AudioSocketServer` [#2-audiosocketserver] A TCP server that accepts AudioSocket connections from the Asterisk `AudioSocket()` dialplan app. Each connection is a `CallSession`'s media channel — frames in, frames out — without RTP or SRTP. The server runs on a port you choose (default: ephemeral) and is auto- started by `VoxtraApp` when audio operations are first used. ### 3. `CallSession` [#3-callsession] The developer-facing handle. Every inbound call and every successful `originate()` produces one. It's what your `@app.route()` handler receives: ```python @app.default() async def handle(call): # ← call: CallSession await call.answer() digit = await call.listen_dtmf(timeout=5) if digit == "1": await call.transfer_to_queue("support") else: await call.bridge_with(other_session) ``` `CallSession` exposes: - **Lifecycle:** `answer`, `hangup`, `hold`, `unhold`, `transfer_to`. - **Audio:** `audio_stream()`, `send_audio()`, `play_file()`. - **DTMF:** `listen_dtmf()`, `send_dtmf()`. - **Recording:** `record_start()`, `record_stop()`. - **AI shortcuts:** `say(text)`, `listen(timeout=)`, `agent.respond(text)`. - **Bridging:** `bridge_with(other)`, `transfer_to_queue(name)`. [Reference →](/voxtra/reference/call-session) ### 4. `VoxtraApp` [#4-voxtraapp] The orchestrator. It: 1. Owns the `ARIClient` connection and event loop. 2. Translates ARI events (`StasisStart`, `StasisEnd`, `ChannelDtmfReceived`, …) into `VoxtraEvent`s. 3. Looks up the right handler in the `Router`. 4. Creates a `CallSession` and runs your handler in a background task. 5. Optionally auto-wires a `VoicePipeline` (when STT + LLM + TTS are configured) and a `BackendWebhook`. 6. Cleans up on hangup. You construct it once, decorate handlers, and call `app.run()`: ```python app = VoxtraApp(ari_url="...", ari_user="...", ari_password="...") @app.default() async def handle(call): ... app.run() ``` [Reference →](/voxtra/reference/voxtra-app) ## The provider registry [#the-provider-registry] STT, TTS, LLM, VAD, telephony, and media providers self-register via decorators: ```python from voxtra.registry import registry from voxtra.ai.stt.base import BaseSTT @registry.register_stt("my-provider") class MySTT(BaseSTT): ... ``` This means third-party packages can ship new providers without touching Voxtra's core. Resolution is lazy — providers aren't imported until something asks for them by name. See [`voxtra.registry`](https://github.com/rexplore-ai/voxtra/blob/main/src/voxtra/registry.py). ## Telephony adapter contract [#telephony-adapter-contract] `BaseTelephonyAdapter` is the seam between Voxtra and the underlying PBX. Voxtra ships an `AsteriskAdapter` (via `ARIClient`) and a `LiveKitAdapter` stub. New adapters implement ten async methods (`connect`, `listen`, `answer_call`, `hangup_call`, `transfer_call`, `hold_call`, `send_dtmf`, `create_media_bridge`, `play_audio`, `disconnect`) and translate the backend's native events into `VoxtraEvent`s. Switch backends in one line: ```python from voxtra import VoxtraApp from voxtra.telephony.asterisk import AsteriskAdapter app = VoxtraApp(telephony=AsteriskAdapter(...)) # or: app = VoxtraApp.with_asterisk(ari_url=..., ari_user=..., ari_password=...) ``` ## Sessions, events, and the queue [#sessions-events-and-the-queue] Every `CallSession` has an `asyncio.Queue` for `VoxtraEvent`s. The framework pushes events onto it; your handler can `await` them via helpers like `listen()`, `listen_dtmf()`, or `audio_stream()`. Events that flow through: - `CALL_STARTED`, `CALL_ANSWERED`, `CALL_ENDED` - `USER_TRANSCRIPT`, `AGENT_RESPONSE` (from the AI pipeline) - `DTMF_RECEIVED` - `MEDIA_STARTED`, `MEDIA_STOPPED` Full taxonomy: [Events →](/voxtra/concepts/events). ## What runs where [#what-runs-where] | Component | Process | Notes | | ---------------- | -------------------------------- | ---------------------------------------------- | | `VoxtraApp` | Your application | One per Stasis app namespace. | | `ARIClient` | Inside `VoxtraApp` | Single HTTP + WS connection, auto-reconnect. | | `AudioSocketServer` | Inside `VoxtraApp` | TCP server, accepts media legs. | | `VoicePipeline` | One per active `CallSession` | Background asyncio task. | | `BackendWebhook` | One per `VoxtraApp` | Owns its own `httpx.AsyncClient`. | | Asterisk | Separate process | Voxtra never assumes single-host deployment. | ## Production-grade defaults [#production-grade-defaults] Voxtra's defaults are tuned for production traffic: - **Reconnects** on ARI WS drops with configurable backoff. - **Idempotent** stop signals — `agents/stop` and `delete_room` no-op cleanly on already-gone resources. - **SIP-aware idle detection** — browser observers leaving doesn't end a call; only a missing SIP leg does. - **HMAC-signed webhooks** — receivers verify origin before acting. - **Best-effort emission** — webhook and recording-sink failures never propagate into the call pipeline. --- # Events (/voxtra/concepts/events) > Voxtra's event taxonomy — every signal that can flow through a CallSession, with the data each event carries and where each fires. Voxtra uses a single typed event class — `VoxtraEvent` — to describe everything that happens during a call. Events flow into a per-session `asyncio.Queue` and your handler consumes them via `listen()`, `listen_dtmf()`, or by iterating `audio_stream()`. ## The shape of an event [#the-shape-of-an-event] Every event has the same base structure: ```python class VoxtraEvent(BaseModel): id: str # uuid4 hex type: EventType # "call.started", "user.transcript", ... session_id: str # the CallSession this belongs to timestamp: datetime # UTC, set on construction data: dict[str, Any] # event-specific payload ``` Specific event types subclass `VoxtraEvent` and add typed fields (for example, `UserTranscriptEvent.text` or `DTMFEvent.digit`). ## Event types [#event-types] The `EventType` enum is the source of truth — these are the values that appear in `event.type` and on the wire when emitted by `BackendWebhook`. ### Call lifecycle [#call-lifecycle] | `EventType` | Wire value | Fires | | ------------------------- | -------------------- | ------------------------------------------------------- | | `CALL_STARTED` | `call.started` | Inbound call enters Stasis app or outbound is created. | | `CALL_RINGING` | `call.ringing` | The far end is alerting (provider-dependent). | | `CALL_ANSWERED` | `call.answered` | The remote party picks up. | | `CALL_ENDED` | `call.ended` | Either side hangs up; deduped across signal sources. | | `CALL_FAILED` | `call.failed` | The originate failed before answer. | | `CALL_TRANSFERRED` | `call.transferred` | The session was redirected to another endpoint. | ### Media [#media] | `EventType` | Wire value | Fires | | ------------------------- | -------------------- | ------------------------------------------------------- | | `MEDIA_STARTED` | `media.started` | AudioSocket connection accepted; bidirectional audio. | | `MEDIA_STOPPED` | `media.stopped` | AudioSocket disconnected (FRAME_HANGUP, EOF, error). | | `AUDIO_FRAME_RECEIVED` | `audio.frame.received` | An inbound media frame is enqueued (rare in handlers). | | `AUDIO_FRAME_SENT` | `audio.frame.sent` | An outbound frame leaves the queue. | ### AI pipeline [#ai-pipeline] | `EventType` | Wire value | Fires | | ------------------------- | ------------------------- | -------------------------------------------------- | | `USER_SPEECH_STARTED` | `user.speech.started` | VAD detects voice on the inbound leg. | | `USER_SPEECH_ENDED` | `user.speech.ended` | VAD detects silence after voice. | | `USER_TRANSCRIPT` | `user.transcript` | STT produced a final transcript. | | `USER_TRANSCRIPT_PARTIAL` | `user.transcript.partial` | STT produced an interim transcript. | | `AGENT_THINKING` | `agent.thinking` | LLM call started. | | `AGENT_RESPONSE` | `agent.response` | LLM produced a reply (with optional tool calls). | | `AGENT_SPEECH_STARTED` | `agent.speech.started` | TTS started streaming the reply. | | `AGENT_SPEECH_ENDED` | `agent.speech.ended` | TTS finished. | ### Control [#control] | `EventType` | Wire value | Fires | | ------------------------- | -------------------- | ------------------------------------------------------- | | `DTMF_RECEIVED` | `dtmf.received` | A DTMF digit lands on the channel. | | `BARGE_IN` | `barge_in` | User starts talking while the agent is speaking. | | `SILENCE_DETECTED` | `silence.detected` | VAD silence threshold elapsed. | | `TURN_ENDED` | `turn.ended` | A logical conversational turn closed. | ### System [#system] | `EventType` | Wire value | Fires | | ------------------------- | ---------------------- | ------------------------------------------------------ | | `ERROR` | `error` | An internal error in the framework or provider. | | `SESSION_CREATED` | `session.created` | A `CallSession` is constructed. | | `SESSION_DESTROYED` | `session.destroyed` | A `CallSession` is finalized. | ## Consuming events in a handler [#consuming-events-in-a-handler] Most code uses the high-level helpers and doesn't touch events directly: ```python @app.default() async def handle(call): await call.answer() await call.say("Welcome.") # listen() awaits USER_TRANSCRIPT internally user = await call.listen(timeout=10) if user: reply = await call.agent.respond(user.text) await call.say(reply.text) ``` When you need fine-grained control, await events directly: ```python from voxtra import EventType @app.default() async def handle(call): await call.answer() while True: event = await call._event_queue.get() # see note below if event.type == EventType.DTMF_RECEIVED: digit = event.data["digit"] # ... elif event.type == EventType.CALL_ENDED: return ``` ## Hangup callbacks [#hangup-callbacks] Register cleanup logic via `call.on_hangup`: ```python @app.default() async def handle(call): await call.answer() @call.on_hangup async def cleanup(): await save_transcript_to_db(call.id) await call.say("Hi!") # ... handler returns; cleanup fires when the channel hangs up ``` Hangup is dispatched exactly once even when both ARI's `StasisEnd` and AudioSocket's `FRAME_HANGUP` fire — the framework dedupes them. ## Webhook delivery [#webhook-delivery] When a `BackendWebhook` is configured, every event also POSTs to your URL with the same JSON shape: ```json { "id": "8a91...", "type": "call.started", "session_id": "ch-1234", "timestamp": "2026-05-04T08:31:21.512Z", "data": { "caller_id": "+265888111111", "called_number": "+265999000001", "direction": "inbound" } } ``` Headers: `X-Voxtra-Event`, `X-Voxtra-Event-Id`, `X-Voxtra-Session-Id`, and (when a `signing_secret` is set) an `X-Voxtra-Signature` containing `hmac_sha256(secret, body)`. See [Webhooks guide](/voxtra/guides/webhooks) for receiver examples. --- # Sessions (/voxtra/concepts/sessions) > CallSession is the developer-facing handle for an active call. Lifecycle, state, audio I/O, and how the framework cleans up after itself. A `CallSession` represents one active call. Every inbound call into your Stasis app, and every successful `app.originate(...)`, produces one. The session is what your handler gets and what you operate on: ```python @app.default() async def handle(call): # call: CallSession ... ``` ## Lifecycle [#lifecycle] ```mermaid stateDiagram-v2 [*] --> Created Created --> Ringing Ringing --> Answered Answered --> InProgress: in-progress InProgress --> Completed Ringing --> Completed: early hangup Answered --> Completed: early hangup InProgress --> Failed Completed --> [*] Failed --> [*] ``` States live on `call.state`: - `RINGING` — created, not yet answered. - `IN_PROGRESS` — answered, audio flowing. - `ON_HOLD` — explicit hold requested. - `COMPLETED` — terminal. - `FAILED` — origination or answer failed. Most handlers don't inspect state directly; the high-level methods (`answer`, `say`, `listen`, `hangup`) wait for the right state on your behalf. ## Identity [#identity] | Attribute | Type | Meaning | | ---------------- | ----------- | --------------------------------------------------------- | | `call.id` | `str` | Unique identifier — same as the Asterisk channel ID. | | `call.caller_id` | `str` | The calling party number (E.164 typically). | | `call.called_number` | `str` | The dialed extension or DID. | | `call.direction` | `CallDirection` | `INBOUND` or `OUTBOUND`. | | `call.metadata` | `dict` | Arbitrary key-value store. Pre-populated with route metadata. | | `call.duration` | `float` | Seconds since `answer()` (0 before answer). | `call.metadata` is the recommended place to stash per-call context. Anything you put there is also visible to AI tool calls and webhook payloads (when you opt in via `metadata.update_for_webhook`). ## Lifecycle methods [#lifecycle-methods] ```python await call.answer() # 200 OK the call await call.hangup() # tear down (idempotent) await call.hold() # MOH on the far end await call.unhold() await call.transfer_to("+265999...") # blind transfer ``` Each is a thin wrapper over the corresponding ARI verb, with safer error handling than the raw client (404-on-already-gone is treated as success). ## Audio I/O [#audio-io] Voxtra exposes two layers of audio API: **High-level (recommended):** ```python await call.play_file("hello-world") # Asterisk-bundled prompt await call.say("This is dynamically generated.") # uses configured TTS text = await call.listen(timeout=10) # awaits USER_TRANSCRIPT ``` **Low-level (raw frames):** ```python async for chunk in call.audio_stream(): # chunk: AudioChunk (codec=μ-law, ~20ms) processed = my_dsp(chunk) await call.send_audio(processed) ``` Use the low-level path when you're doing custom DSP, plugging in a non- Voxtra STT, or routing audio to an external service. ## DTMF [#dtmf] ```python digit = await call.listen_dtmf(timeout=5) if digit == "1": ... await call.send_dtmf("4321") # send DTMF to the far end ``` `listen_dtmf` consumes from a dedicated DTMF queue so it doesn't compete with `listen()` (which awaits transcripts). ## Recording [#recording] ```python name = await call.record_start() # auto-generated name # ... call continues ... await call.record_stop() # fires the configured RecordingSink ``` If a sink is configured at the app level (`VoxtraApp(recording_sink=...)`) or per-call (`record_start(sink=...)`), it receives a `RecordingMetadata` object on stop. See [Recording guide](/voxtra/guides/recording). ## Bridging [#bridging] Two sessions can be merged into a single audio bridge — typical for human handoff after an AI conversation: ```python async def transfer_to_agent(ai_call, agent_session): await ai_call.bridge_with(agent_session) # both calls now share audio ``` For agent queues: ```python await call.transfer_to_queue("support-queue") ``` ## AI shortcuts [#ai-shortcuts] When STT + LLM + TTS are configured on the `VoxtraApp`, every session gets an auto-wired `VoicePipeline` and exposes: ```python await call.say(text) # synthesize + play user = await call.listen(timeout=10) # transcribe inbound audio reply = await call.agent.respond(text) # LLM call with conversation history ``` The `agent` object maintains per-session message history, so multi-turn conversations work without you stitching things together. If the pipeline isn't configured (no STT/LLM/TTS), these methods raise `RuntimeError("AI pipeline not configured")` so failures are loud. ## Cleanup contract [#cleanup-contract] Voxtra guarantees: 1. Each `CallSession` is removed from `app._sessions` exactly once. 2. `on_hangup` callbacks fire exactly once. 3. The auto-wired pipeline task is cancelled on hangup. 4. The recording sink is invoked exactly once when `record_stop` is called (or as part of automatic stop on hangup, if recording was active). If your handler returns without calling `hangup`, the framework hangs the call up for you in the `finally` block of `_run_handler`. ## Pattern: handler skeleton [#pattern-handler-skeleton] ```python @app.default() async def handle(call): await call.answer() @call.on_hangup async def save(): await persist_call(call.id, call.metadata) try: await call.say("Welcome to Acme support.") digit = await call.listen_dtmf(timeout=5) if digit == "1": await call.transfer_to_queue("support") else: await call.say("Goodbye.") await call.hangup() except Exception: await call.hangup() raise ``` The `try/except` is optional — the framework already wraps your handler in error handling — but explicit cleanup of mid-call state goes here. --- # Routing (/voxtra/concepts/routing) > Map inbound DIDs and extensions to async handlers using Voxtra's declarative router. Static routes, number patterns, metadata, and fallback handling. Voxtra dispatches every inbound call through a `Router`. You register handlers with decorators and the framework picks the right one based on the called extension or number. ## Static routes [#static-routes] The simplest case — match an exact extension or number: ```python @app.route(extension="1000") async def support(call): ... @app.route(number="+265888111111") async def vip(call): ... ``` `extension` matches the dialed extension exposed by the dialplan (`channel.dialplan_exten`). `number` matches `caller_id` — the calling party. You can pass either, both, or neither (combined with `name=`). ## Default handler [#default-handler] Always register a default. It's the fallback when no static route matches. ```python @app.default() async def fallback(call): await call.answer() await call.play_file("vm-nobodyavail") await call.hangup() ``` `@app.default_route()` is an alias kept for backward compatibility. Without a default, unmatched calls are hung up immediately and a warning is logged. ## Metadata on routes [#metadata-on-routes] Attach arbitrary metadata to a route. It's merged into `call.metadata` when that route fires: ```python @app.route(extension="1000", metadata={"queue": "support", "priority": "high"}) async def support(call): queue = call.metadata["queue"] # "support" priority = call.metadata["priority"] # "high" await call.transfer_to_queue(queue) ``` This is the cleanest way to keep per-route configuration co-located with the handler. ## Resolution order [#resolution-order] When a call comes in, the router checks routes in the order they were registered: 1. **Static routes** — first one whose `extension`/`number` matches. 2. **Dispatch rules** (advanced — see below). 3. **Default handler** if registered. 4. Otherwise: hang up with a warning. Static-route metadata is merged onto the session before the handler runs. Dispatch-rule and default-handler dispatches don't carry metadata. ## Dispatch rules [#dispatch-rules] For dynamic routing — for example, "any number ending in `0` goes to sales" — register a `DispatchRule`: ```python from voxtra.router import DispatchRule class SalesRule(DispatchRule): def matches(self, *, extension, number): return number and number.endswith("0") async def handler(self, call): await call.answer() await call.say("Sales department.") ... app.router.dispatch_rules.append(SalesRule()) ``` Dispatch rules run after static routes and before the default. Use them sparingly — most cases are clearer as static routes plus business logic inside the handler. ## Programmatic registration [#programmatic-registration] You don't have to use decorators. The same registrations work imperatively, which is useful when handlers come from configuration: ```python async def support_handler(call): ... app.router.route(extension="1000")(support_handler) app.router.default()(fallback_handler) ``` This pattern composes well with `VoxtraApp.from_config(...)` — configuration drives which handlers register. ## Multi-tenant: app-name namespacing [#multi-tenant-app-name-namespacing] Voxtra's primary multi-tenant primitive is the **Stasis app name**, not the router. One Asterisk cluster can host many `VoxtraApp` instances, each subscribed to its own Stasis app: ```python acme = VoxtraApp(app_name="voxtra-acme", ari_url=..., ari_user=..., ari_password=...) beta = VoxtraApp(app_name="voxtra-beta", ari_url=..., ari_user=..., ari_password=...) ``` Each instance runs its own router and only sees calls dispatched to its Stasis app via `Stasis(voxtra-acme)` in the dialplan. See the [Multi-tenant guide](/voxtra/guides/multi-tenant) for `TenantProvisioner`, which auto-generates the dialplan, ARI user, and PJSIP fragments per tenant. ## Inspection [#inspection] ```python # All registered static routes app.router.routes # list[Route] # All registered dispatch rules app.router.dispatch_rules # list[DispatchRule] # The default handler (or None) app.router.default_handler ``` Useful in tests and admin endpoints that surface "which DIDs are wired?". ## Common patterns [#common-patterns] ### Per-tenant DID routing [#per-tenant-did-routing] ```python @app.route(number="+265999000001", metadata={"tenant_id": "acme"}) async def acme_inbound(call): await dispatch_to_tenant_workflow(call, call.metadata["tenant_id"]) @app.route(number="+265999000002", metadata={"tenant_id": "beta"}) async def beta_inbound(call): await dispatch_to_tenant_workflow(call, call.metadata["tenant_id"]) ``` ### IVR menu [#ivr-menu] ```python @app.default() async def menu(call): await call.answer() while True: await call.say("Press 1 for sales, 2 for support, 0 for an agent.") digit = await call.listen_dtmf(timeout=5) if digit == "1": await call.transfer_to_queue("sales") return if digit == "2": await call.transfer_to_queue("support") return if digit == "0": await call.transfer_to_queue("agents") return await call.say("Invalid choice, please try again.") ``` ### One handler with sub-dispatch [#one-handler-with-sub-dispatch] When you want a single entry point that branches on metadata: ```python @app.route(extension="1000", metadata={"flow": "support"}) @app.route(extension="2000", metadata={"flow": "sales"}) async def shared(call): flow = call.metadata.get("flow", "default") await getattr(handlers, flow)(call) ``` (Note: `@app.route` returns the original function so stacking decorators works naturally.) --- # AI Voice Agent (/voxtra/guides/ai-voice-agent) > Wire Deepgram (STT) + OpenAI (LLM) + ElevenLabs (TTS) into Voxtra and let your call handler hold a conversation. Includes barge-in, tool calls, and conversation history. This guide builds a fully-functional AI voice agent on top of Voxtra: the caller talks, an LLM responds, the response is spoken back, and the agent handles barge-in (when the caller talks over the agent). ## Install the providers [#install-the-providers] ```bash pip install "voxtra[deepgram,openai,elevenlabs]" ``` Each extra is optional — you can mix and match based on what you have keys for. Other providers register via the [provider registry](/voxtra/concepts/architecture). ## Wire it up [#wire-it-up] ```python title="agent.py" from voxtra import VoxtraApp from voxtra.ai.stt.deepgram import DeepgramSTT from voxtra.ai.tts.elevenlabs import ElevenLabsTTS from voxtra.ai.llm.openai import OpenAIAgent from voxtra.ai.vad import EnergyVAD app = VoxtraApp( ari_url="http://pbx:8088", ari_user="asterisk", ari_password="secret", stt=DeepgramSTT(api_key="dg-..."), llm=OpenAIAgent( api_key="sk-...", model="gpt-4o-mini", system_prompt="You are a helpful customer-support agent for Acme.", ), tts=ElevenLabsTTS(api_key="el-...", voice_id="..."), vad=EnergyVAD(), ) @app.default() async def handle(call): await call.answer() await call.say("Thanks for calling Acme. How can I help?") while call.state == "in-progress": user = await call.listen(timeout=10) if user is None: await call.say("Are you still there?") continue reply = await call.agent.respond(user.text) await call.say(reply.text) if reply.tool_calls and any(t["name"] == "end_call" for t in reply.tool_calls): await call.say("Thanks. Goodbye.") await call.hangup() return app.run() ``` That's the whole thing. Voxtra auto-wires a `VoicePipeline` per session when STT + LLM + TTS are all configured — you don't construct the pipeline yourself. ## How `say` and `listen` work [#how-say-and-listen-work] Under the hood: - `call.say(text)` runs the configured TTS and sends the resulting audio frames through the AudioSocket connection. It awaits the `AGENT_SPEECH_ENDED` event before returning. - `call.listen(timeout=)` awaits a `USER_TRANSCRIPT` event from the pipeline. `None` is returned on timeout. Partial transcripts (which fire as the user speaks) are filtered out — you only see finals. - `call.agent.respond(text)` calls the LLM with the running conversation history. The history persists for the lifetime of the `CallSession`. ## Conversation history [#conversation-history] `call.agent` keeps state for you: ```python await call.agent.respond("My name is Patrick.") # ... later in the same call ... reply = await call.agent.respond("What's my name?") # reply.text → "Your name is Patrick." ``` To inspect or seed history manually: ```python call.agent.history # list[dict] call.agent.history.append({"role": "system", "content": "..."}) ``` ## Barge-in [#barge-in] When the caller starts speaking while the agent is mid-sentence, Voxtra emits a `BARGE_IN` event and stops the in-flight TTS. The caller hears their own audio cleanly — no echo of the cancelled agent audio. Barge-in is on by default. Disable it for transactional confirmations where the user shouldn't be able to interrupt: ```python await call.say("Your verification code is one two three. Did you get that?", interruptible=False) user = await call.listen(timeout=5) ``` ## Tool calls [#tool-calls] If your LLM provider supports tools, `respond()` returns them in `reply.tool_calls`: ```python reply = await call.agent.respond(user.text) for tool in reply.tool_calls: if tool["name"] == "lookup_order": order = await db.fetch_order(tool["arguments"]["order_id"]) # Feed the result back to the agent await call.agent.add_tool_result(tool["id"], result=str(order)) reply = await call.agent.respond("") # follow-up turn await call.say(reply.text) ``` Define the tool schemas at agent-construction time: ```python llm = OpenAIAgent( api_key="...", model="gpt-4o-mini", system_prompt="...", tools=[ { "type": "function", "function": { "name": "lookup_order", "description": "Fetch order details by ID.", "parameters": { "type": "object", "properties": {"order_id": {"type": "string"}}, "required": ["order_id"], }, }, } ], ) ``` ## Idle handling [#idle-handling] Voxtra ships an `IdleMonitor` that ends sessions after prolonged silence on the SIP leg. By default it triggers after 30s of "no SIP participant present"; browser observers leaving doesn't count. When you want to suspend idle handling — for example, during a human handoff — flip the suspended flag: ```python @app.default() async def handle(call): await call.answer() # ... AI conversation ... await call.bridge_with(human_agent_session) # Don't time out the call while a human is talking to the customer if call.idle_monitor: call.idle_monitor.suspended = True ``` ## Switching providers [#switching-providers] The provider registry makes this a one-line change. Configure a different STT without touching anything else: ```python from voxtra.ai.stt.assembly import AssemblyAISTT app = VoxtraApp( ..., stt=AssemblyAISTT(api_key="..."), # ← swap here llm=OpenAIAgent(...), tts=ElevenLabsTTS(...), ) ``` ## Production tips [#production-tips] ### Run STT, TTS, and LLM in the same region [#run-stt-tts-and-llm-in-the-same-region] Voice latency is dominated by network round-trips. Put your Voxtra process in the same cloud region as your STT and TTS providers when possible. ### Buffer caps matter [#buffer-caps-matter] `MediaConfig.buffer_size_ms` (default 200ms) is your jitter tolerance. Increase for noisier networks; decrease for tighter responsiveness. ### Use tool calls for handoff [#use-tool-calls-for-handoff] Don't let the LLM hallucinate "I'll transfer you now." Define an `escalate_to_human` tool and act on the tool call — the LLM tells you when to transfer instead of relying on text-pattern matching. ### Save transcripts [#save-transcripts] Register an `on_hangup` callback that persists `call.agent.history` to your database. The webhook system can also forward `USER_TRANSCRIPT` and `AGENT_RESPONSE` in real time — see [Webhooks](/voxtra/guides/webhooks). Keep your system prompt short. Every turn re-sends the full history; bloated prompts waste tokens and add latency. The LLM doesn't need procedural rules in the system prompt — encode them in tools instead. --- # Inbound & Outbound Calls (/voxtra/guides/inbound-and-outbound) > Handle inbound traffic from a SIP trunk and originate outbound calls through Voxtra. Includes dialplan setup, call origination, and the difference between Stasis and dialplan routing. Voxtra handles both directions through the same `CallSession` API. The only differences are how the call enters the system and which routing mode you use. ## Inbound calls [#inbound-calls] ### Dialplan to Stasis [#dialplan-to-stasis] Add the inbound trunk to a dialplan context that hands the call off to your Voxtra Stasis app: ```ini title="/etc/asterisk/extensions.conf" [from-trunk] exten => _X.,1,NoOp(Inbound to Voxtra) same => n,Stasis(voxtra) same => n,Hangup() ``` `voxtra` here is your `VoxtraApp.app_name`. If you're running multi- tenant, each tenant gets its own Stasis app (`voxtra-acme`, `voxtra-beta`, …) and a matching dialplan stanza. ### Per-DID routing [#per-did-routing] ```ini title="/etc/asterisk/extensions.conf" [from-trunk] exten => +265999000001,1,Stasis(voxtra) ; ACME exten => +265999000002,1,Stasis(voxtra) ; Beta exten => _X.,1,Stasis(voxtra) ; everything else ``` The dialed number (`+265999000001`) becomes `call.called_number` on the session, which the router matches against `@app.route(extension="...")`. ### Reload the dialplan [#reload-the-dialplan] ```bash asterisk -rx "dialplan reload" ``` Voxtra also exposes [`TenantProvisioner.reload_asterisk()`](/voxtra/reference/provisioning) for programmatic reloads via ARI. ### The handler [#the-handler] ```python from voxtra import VoxtraApp app = VoxtraApp(ari_url="...", ari_user="...", ari_password="...") @app.route(extension="+265999000001") async def acme_inbound(call): await call.answer() await call.play_file("acme-greeting") digit = await call.listen_dtmf(timeout=5) if digit == "1": await call.transfer_to_queue("acme-support") else: await call.play_file("vm-nobodyavail") await call.hangup() @app.default() async def fallback(call): await call.answer() await call.play_file("vm-goodbye") await call.hangup() app.run() ``` ## Outbound calls [#outbound-calls] ### Stasis-routed origination [#stasis-routed-origination] `VoxtraApp.originate` creates an outbound call that lands directly in your Stasis app: ```python import asyncio async def main(): await app.start() call = await app.originate( endpoint="PJSIP/+265999123456@my-trunk", caller_id="+265888000001", timeout=30, ) await call.answer() await call.say("Hi, this is Acme calling.") await call.hangup() await app.stop() asyncio.run(main()) ``` The returned `CallSession` works identically to an inbound one — same `answer`, `say`, `listen`, etc. ### Dialplan-routed origination [#dialplan-routed-origination] When you want the outbound call to enter your existing dialplan (necessary if downstream logic reads channel variables or hooks the call into routing rules), use the lower-level `ARIClient.originate` with `context=` and `extension=`: ```python channel = await app.ari.originate( endpoint="PJSIP/+265999123456@my-trunk", app=None, # disable Stasis routing context="from-trunk-out", extension="+265999123456", caller_id="+265888000001", variables={ "MY_CALL_ID": "abc-123", "MY_RECORD": "1", }, ) ``` The dialplan can read `${MY_CALL_ID}` and `${MY_RECORD}`, and your existing logic continues to fire on every outbound call. This is the mode Luso8 uses in production — the dialplan reads `LUSO8_*` channel variables and bridges the call into a LiveKit room for AI handling. See the [Luso8 production deployment](/voxtra/examples) example. ### Channel variables [#channel-variables] Voxtra serializes the `variables=` dict to the ARI `variables` field (JSON-wrapped, as ARI requires). All values are stringified, so: ```python await app.ari.originate( endpoint="PJSIP/+265999@trunk", context="from-trunk-out", extension="+265999", variables={ "TENANT_ID": "acme", "RECORD_CALL": "1", "OBJECTIVE": "Confirm appointment for Tuesday", }, ) ``` In dialplan: ```ini [from-trunk-out] exten => _+X.,1,NoOp(Outbound for ${TENANT_ID}) same => n,GotoIf($["${RECORD_CALL}" = "1"]?record:dial) same => n(record),MixMonitor(${UNIQUEID}.wav) same => n(dial),Dial(PJSIP/${EXTEN}@trunk-out,30) same => n,Hangup() ``` ## Outbound batches [#outbound-batches] For dialer-style use cases — placing many calls in sequence with concurrency limits — combine `app.originate` with a semaphore: ```python import asyncio async def dial_one(number, script): call = await app.originate( endpoint=f"PJSIP/{number}@my-trunk", caller_id="+265888000001", ) await call.answer() await call.say(script) await call.hangup() async def dial_batch(numbers, script, concurrency=10): sem = asyncio.Semaphore(concurrency) async def guarded(n): async with sem: try: await dial_one(n, script) except Exception as exc: logger.warning("Failed to call %s: %s", n, exc) await asyncio.gather(*[guarded(n) for n in numbers]) ``` In production you'll want call-state tracking, retries, and pacing — Luso8's batch implementation in [`asterisk.py`](https://github.com/rexplore-ai/luso8/blob/master/luso8.backend/app/api/v1/endpoints/asterisk.py) is a good starting point. ## Hangup detection [#hangup-detection] Voxtra dispatches `CALL_ENDED` when *any* of: 1. The far side hangs up (ARI `StasisEnd`, `ChannelDestroyed`). 2. The AudioSocket connection drops (`FRAME_HANGUP`, EOF, error). 3. Your handler calls `call.hangup()`. Exactly one `CALL_ENDED` is dispatched per session — duplicates are deduped. Register cleanup via `call.on_hangup`: ```python @call.on_hangup async def cleanup(): await persist(call.id) ``` ## Common patterns [#common-patterns] ```python @app.default() async def handle(call): await call.answer() await call.play_file("welcome-prompt") await call.hangup() ``` ```python @app.default() async def handle(call): await call.answer() while True: await call.say("Press 1 for sales, 2 for support, 3 to leave a message.") digit = await call.listen_dtmf(timeout=5) if digit == "1": await call.transfer_to_queue("sales") return if digit == "2": await call.transfer_to_queue("support") return if digit == "3": await call.play_file("vm-intro") await call.record_start("voicemail") await asyncio.sleep(60) await call.record_stop() await call.hangup() return await call.say("Invalid choice.") ``` ```python @app.default() async def handle(call): await call.answer() answers = [] for question in ["How likely are you to recommend us, 1 to 9?", "What's the main reason for that score?"]: await call.say(question) if "score" in question.lower(): answer = await call.listen_dtmf(timeout=10) else: user = await call.listen(timeout=15) answer = user.text if user else "" answers.append(answer) await save_survey(call.caller_id, answers) await call.say("Thanks for your feedback.") await call.hangup() ``` --- # Webhooks (/voxtra/guides/webhooks) > Push every Voxtra event to your backend over HTTP. Includes HMAC signing, retry semantics, and a reference receiver. `BackendWebhook` is the bridge between Voxtra's in-process event stream and your downstream services. Configure a URL once, and every `VoxtraEvent` POSTs to it as a fire-and-forget request — without blocking the call pipeline. ## When to use webhooks [#when-to-use-webhooks] - Sync call state to a CRM (Salesforce, HubSpot). - Fire billing events when a call answers / ends. - Stream live transcripts to a dashboard. - Trigger downstream automation (e.g. Slack notification on barge-in). - Mirror call activity into your data warehouse. ## Configure [#configure] ```python from voxtra import VoxtraApp, BackendWebhook from voxtra.config import WebhookConfig webhook = BackendWebhook( WebhookConfig( url="https://api.example.com/webhooks/voxtra", signing_secret="please-rotate-me", events=["call.started", "call.answered", "call.ended"], max_retries=3, retry_backoff=1.0, ), ) app = VoxtraApp( ari_url="...", ari_user="...", ari_password="...", webhook=webhook, ) ``` `events=[]` (the default) emits **every** event type. ## What gets sent [#what-gets-sent] Each request is a POST with a JSON body matching the [event schema](/voxtra/concepts/events#the-shape-of-an-event): ```json { "id": "8a91c2...", "type": "call.started", "session_id": "ch-1234", "timestamp": "2026-05-04T08:31:21.512Z", "data": { "caller_id": "+265888111111", "called_number": "+265999000001", "direction": "inbound" } } ``` Headers: | Header | Value | | --------------------- | ------------------------------------------------ | | `Content-Type` | `application/json` | | `User-Agent` | `voxtra-webhook/1` | | `X-Voxtra-Event` | The event type, e.g. `call.started` | | `X-Voxtra-Event-Id` | The event's `id` (idempotency key) | | `X-Voxtra-Session-Id` | The `session_id` | | `X-Voxtra-Signature` | `hmac_sha256(secret, body)` (when `signing_secret` set) | ## Verify the signature [#verify-the-signature] ```python import hashlib import hmac from fastapi import FastAPI, Header, HTTPException, Request WEBHOOK_SECRET = b"please-rotate-me" app = FastAPI() @app.post("/webhooks/voxtra") async def voxtra( request: Request, x_voxtra_signature: str = Header(...), x_voxtra_event_id: str = Header(...), ): body = await request.body() expected = hmac.new(WEBHOOK_SECRET, body, hashlib.sha256).hexdigest() if not hmac.compare_digest(expected, x_voxtra_signature): raise HTTPException(status_code=401, detail="bad signature") # Idempotency: drop if we've seen this event before. if await seen(x_voxtra_event_id): return {"status": "duplicate"} payload = await request.json() await dispatch(payload) return {"status": "ok"} ``` ```js import express from 'express' import crypto from 'node:crypto' const SECRET = 'please-rotate-me' const app = express() app.post('/webhooks/voxtra', express.raw({ type: 'application/json' }), (req, res) => { const sig = req.header('x-voxtra-signature') const expected = crypto.createHmac('sha256', SECRET).update(req.body).digest('hex') if (!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(sig))) { return res.status(401).send('bad signature') } const payload = JSON.parse(req.body.toString('utf-8')) // ... res.json({ status: 'ok' }) }) ``` ```go package main import ( "crypto/hmac" "crypto/sha256" "encoding/hex" "io" "net/http" ) const secret = "please-rotate-me" func voxtraHandler(w http.ResponseWriter, r *http.Request) { body, _ := io.ReadAll(r.Body) mac := hmac.New(sha256.New, []byte(secret)) mac.Write(body) expected := hex.EncodeToString(mac.Sum(nil)) if !hmac.Equal([]byte(expected), []byte(r.Header.Get("X-Voxtra-Signature"))) { http.Error(w, "bad signature", http.StatusUnauthorized) return } // ... w.Write([]byte(`{"status":"ok"}`)) } ``` ## Retry semantics [#retry-semantics] | Outcome | Retry? | | ----------------- | --------------------------------- | | 2xx | Done. | | 4xx | No — receiver bug, won't fix. | | 5xx | Yes, with exponential backoff. | | Transport error | Yes, with exponential backoff. | Backoff doubles each attempt starting at `retry_backoff` seconds. After `max_retries` failed attempts the event is logged at WARNING and dropped. Webhook delivery is **at-most-once**. For at-least-once semantics (sufficient for billing / CRM use cases), persist events on the receiver side using `X-Voxtra-Event-Id` as the idempotency key, then reconcile periodically against authoritative state from your own database. ## Filtering events [#filtering-events] Pass an allowlist to keep traffic small: ```python WebhookConfig( url="https://api.example.com/webhooks/voxtra", events=[ "call.started", "call.answered", "call.ended", "user.transcript", # only finals (no partials) "agent.response", ], ) ``` The full list of `EventType` values is in the [Events reference](/voxtra/concepts/events). ## Production deployment [#production-deployment] ### Receiver should respond fast [#receiver-should-respond-fast] Voxtra's HTTP timeout defaults to 10 seconds. Long-running work on the receiver — DB writes that take seconds, complex orchestration — should return 2xx quickly and process asynchronously (queue, worker, etc.). ### Health check the receiver [#health-check-the-receiver] Add a `/health` endpoint your monitoring polls. Webhook drops are silent in Voxtra logs (by design — they don't break calls); you need external observability. ### Rotate the signing secret [#rotate-the-signing-secret] `WebhookConfig.signing_secret` can be a string or fetched from a secret manager at construction time. Rotate quarterly. To roll without downtime: support both old + new secrets on the receiver, switch Voxtra to the new secret, then drop the old one. ### Observe drift [#observe-drift] A reconciliation job that periodically pulls authoritative call state from Asterisk (or your DB) and compares against what your webhook receiver wrote is the safety net against missed events. Luso8 does this every five minutes — see [Call reconciler](https://github.com/rexplore-ai/luso8/blob/master/luso8.backend/app/tasks/call_reconciler.py). ## Sharing an HTTP client [#sharing-an-http-client] By default `BackendWebhook` owns its `httpx.AsyncClient` and closes it on `app.stop()`. Pass an external client to share it across multiple emitters or other code: ```python import httpx shared = httpx.AsyncClient(timeout=10.0) webhook = BackendWebhook( WebhookConfig(url="..."), http_client=shared, ) # Voxtra won't close `shared` — you do, when your app shuts down. ``` ## Reference [#reference] [`BackendWebhook` API reference →](/voxtra/reference/webhooks) --- # Recording (/voxtra/guides/recording) > Record calls and ship the resulting files anywhere — GCS, S3, or your own pipeline — using Voxtra's pluggable RecordingSink interface. Voxtra writes recordings via Asterisk's native ARI recording API (`/var/spool/asterisk/recording/`). What's pluggable is **what happens after the recording stops** — Voxtra calls a `RecordingSink` with a metadata payload, and your sink ships the file wherever it needs to go. ## Anatomy [#anatomy] ```mermaid flowchart TD Start(["call.record_start()"]) Asterisk["Asterisk MixMonitor / record API
writes to /var/spool/asterisk/recording/"] Stop(["call.record_stop()"]) Sink["RecordingSink
on_recording_complete(metadata)
↑ you implement this"] Storage["GCS · S3 · S3-compatible
· webhook to your service
· local archival …"] Start --> Asterisk Asterisk --> Stop Stop --> Sink Sink --> Storage classDef call fill:#dcfce7,stroke:#166534,color:#14532d classDef pbx fill:#fef3c7,stroke:#b45309,color:#78350f classDef hook fill:#ede9fe,stroke:#5b21b6,color:#2e1065 classDef store fill:#e0f2fe,stroke:#0369a1,color:#0c4a6e class Start,Stop call class Asterisk pbx class Sink hook class Storage store ``` The sink is purely a notification — Voxtra never reads the audio file itself, never holds it in memory, and never ships bytes anywhere. That keeps the library small and your storage choice flexible. ## Built-in sinks [#built-in-sinks] ### `LocalFileSink` (default no-op) [#localfilesink-default-no-op] Logs a debug line and does nothing else. Use as a placeholder when you want recording on but don't yet have an upload path: ```python from voxtra.recording import LocalFileSink app = VoxtraApp(..., recording_sink=LocalFileSink()) ``` ### `WebhookSink` [#webhooksink] POSTs the recording metadata to an HTTP URL. The receiver is responsible for fetching the audio (via Asterisk's HTTP recording endpoint, an `scp`, or anything else) and uploading it to long-term storage. ```python from voxtra.recording import WebhookSink sink = WebhookSink( "https://api.example.com/webhooks/recording", signing_secret="please-rotate-me", ) app = VoxtraApp(..., recording_sink=sink) ``` Payload: ```json { "session_id": "ch-1234", "name": "voxtra-rec-...", "file_path": "/var/spool/asterisk/recording/voxtra-rec-....wav", "duration_seconds": 42.3, "format": "wav", "extra": {} } ``` When `signing_secret` is set, the request includes `X-Voxtra-Signature` with `hmac_sha256(secret, body)` — same scheme as the [event webhooks](/voxtra/guides/webhooks). ### `CompositeSink` [#compositesink] Fan a single recording event out to multiple sinks. Per-sink errors are isolated, so a slow or broken sink can't starve the others: ```python from voxtra.recording import CompositeSink, WebhookSink, LocalFileSink sink = CompositeSink( LocalFileSink(), # local debug log WebhookSink("https://crm.example.com/recordings"), # CRM WebhookSink("https://archive.example.com/recordings"), # archive ) app = VoxtraApp(..., recording_sink=sink) ``` ## Custom sinks [#custom-sinks] Implement `RecordingSink` for any custom behaviour: ```python from voxtra.recording import RecordingSink, RecordingMetadata from google.cloud import storage class GCSSink(RecordingSink): """Upload finished recordings to a GCS bucket.""" def __init__(self, bucket: str, prefix: str = ""): self._bucket = storage.Client().bucket(bucket) self._prefix = prefix async def on_recording_complete(self, meta: RecordingMetadata) -> None: blob_name = f"{self._prefix}{meta.session_id}/{meta.name}.{meta.format}" blob = self._bucket.blob(blob_name) # google-cloud-storage is sync; offload so we don't block the loop. import asyncio await asyncio.to_thread(blob.upload_from_filename, meta.file_path) logger.info("Uploaded %s to gs://%s/%s", meta.name, self._bucket.name, blob_name) ``` Then wire it in: ```python app = VoxtraApp( ari_url="...", ari_user="...", ari_password="...", recording_sink=GCSSink(bucket="my-call-recordings", prefix="prod/"), ) ``` Sinks must not raise into the call pipeline. The framework wraps every `on_recording_complete` call in a try/except as a safety net, but well-behaved sinks should catch their own errors and log them. ## Per-call sinks [#per-call-sinks] Override the app default for a single recording: ```python @app.default() async def handle(call): await call.answer() # This call uses a different sink — say, a high-priority bucket. await call.record_start(sink=PrioritySink()) await call.say("This call may be recorded for quality assurance.") user = await call.listen(timeout=30) ... await call.record_stop() ``` When `sink=` is omitted, `record_stop` falls back to the app-level default (`VoxtraApp(recording_sink=...)`). ## Recording lifetime [#recording-lifetime] | Phase | What Voxtra does | | ---------------- | ---------------------------------------------------------- | | `record_start()` | POSTs to ARI `/channels/{id}/record`. Stores name + format. | | Mid-call | Asterisk writes the file. Voxtra has no involvement. | | `record_stop()` | POSTs to ARI `/recordings/live/{name}/stop`. Calls the sink with metadata. | | Hangup mid-recording | If the recording is still active, `record_stop` is implicitly called as part of session cleanup. | ## File-path semantics [#file-path-semantics] `RecordingMetadata.file_path` is a **best-effort** guess at where Asterisk wrote the file: ``` /var/spool/asterisk/recording/{recording_name}.{format} ``` If your Asterisk deployment moves recordings (CDR-driven uploads, custom MixMonitor paths), treat `file_path` as a hint, not a guarantee. Use Asterisk's `recordingfinished` AMI/CDR event to find the canonical location, or query ARI for stored-recording metadata via the raw client. ## Format options [#format-options] `record_start(fmt=)` accepts any format Asterisk supports — `wav`, `gsm`, `ulaw`, `alaw`, `wav49`, etc. ```python await call.record_start(fmt="wav") # 16-bit PCM, ~1MB/min await call.record_start(fmt="gsm") # narrowband, ~100KB/min ``` For maximum-fidelity transcription downstream, prefer `wav`. For storage-bound use cases, `gsm` is ~10x smaller. ## Reference [#reference] [`RecordingSink` API reference →](/voxtra/reference/recording) --- # Multi-tenant SaaS (/voxtra/guides/multi-tenant) > Run one Asterisk cluster as a multi-tenant SaaS using Voxtra's Stasis-app namespacing and TenantProvisioner. Per-tenant ARI users, PJSIP trunks, and dialplan, generated programmatically. Voxtra is designed from the ground up to host many tenants on one Asterisk cluster. The primary isolation primitive is the **Stasis app name** — each tenant gets its own Voxtra process subscribed to its own Stasis app, so events for one tenant never leak into another. ## The model [#the-model] ```mermaid flowchart TD Asterisk["Asterisk PBX
(one shared cluster)"] Acme["VoxtraApp · acme
Stasis(voxtra-acme)"] Beta["VoxtraApp · beta
Stasis(voxtra-beta)"] Gamma["VoxtraApp · gamma
Stasis(voxtra-gamma)"] Asterisk -->|ARI| Acme Asterisk -->|ARI| Beta Asterisk -->|ARI| Gamma classDef pbx fill:#fef3c7,stroke:#b45309,color:#78350f classDef tenantA fill:#dcfce7,stroke:#166534,color:#14532d classDef tenantB fill:#e0f2fe,stroke:#0369a1,color:#0c4a6e classDef tenantC fill:#fce7f3,stroke:#9d174d,color:#831843 class Asterisk pbx class Acme tenantA class Beta tenantB class Gamma tenantC ``` Each `VoxtraApp` has: - A unique `app_name` (e.g. `voxtra-acme`). - Its own ARI user with a scoped password. - Its own dialplan context routing inbound DIDs to the right Stasis app. - Optionally its own PJSIP trunk, queues, and AudioSocket port. ## The provisioner [#the-provisioner] `TenantProvisioner` generates all the Asterisk config fragments for a tenant from a single declarative `TenantConfig`: ```python from voxtra.provisioning.provisioner import TenantConfig, TenantProvisioner from voxtra.types import SIPTrunk provisioner = TenantProvisioner(output_dir="/etc/asterisk/voxtra.d") tenant = TenantConfig( tenant_id="acme-corp", tenant_name="ACME Corp", sip_trunk=SIPTrunk( host="sip.carrier.com", username="acme", password="s3cret", did="+265999123456", ), dids=["+265999123456", "+265999123457"], max_channels=10, ) # Generate config fragments files = provisioner.provision(tenant) # files == { # "ari_acme-corp.conf": "...", # "pjsip_acme-corp.conf": "...", # "extensions_acme-corp.conf": "...", # } # Write to disk provisioner.write_files(files) # Trigger live reload via ARI (no SSH or asterisk -rx needed) await provisioner.reload_asterisk(app.ari) ``` ## What gets generated [#what-gets-generated] ### `ari_{slug}.conf` [#ari_slugconf] A scoped ARI user for the tenant: ```ini [voxtra-acme-corp] type = user read_only = no password = password_format = plain ``` ### `pjsip_{slug}.conf` [#pjsip_slugconf] Endpoint, auth, AOR, registration, and identify sections for the tenant's SIP trunk: ```ini [voxtra-acme-corp-trunk-auth] type = auth auth_type = userpass username = acme password = s3cret [voxtra-acme-corp-trunk-aor] type = aor contact = sip:sip.carrier.com:5060 [voxtra-acme-corp-trunk] type = endpoint context = voxtra-acme-corp-inbound disallow = all allow = ulaw/alaw outbound_auth = voxtra-acme-corp-trunk-auth aors = voxtra-acme-corp-trunk-aor ... ``` ### `extensions_{slug}.conf` [#extensions_slugconf] Inbound dialplan routing into the tenant's Stasis app, plus optional outbound and queue contexts: ```ini [voxtra-acme-corp-inbound] exten => _X.,1,NoOp(Voxtra inbound for tenant acme-corp) same => n,Stasis(voxtra-acme-corp) same => n,Hangup() exten => 265999123456,1,NoOp(Voxtra DID +265999123456 for acme-corp) same => n,Stasis(voxtra-acme-corp) same => n,Hangup() ``` ## Wire the fragments into Asterisk [#wire-the-fragments-into-asterisk] In your top-level Asterisk configs, include the per-tenant directory: ```ini title="/etc/asterisk/extensions.conf" #include "voxtra.d/extensions_*.conf" ``` ```ini title="/etc/asterisk/pjsip.conf" #include "voxtra.d/pjsip_*.conf" ``` ```ini title="/etc/asterisk/ari.conf" #include "voxtra.d/ari_*.conf" ``` This pattern (the **Config Fragment Pattern**) means provisioning a new tenant doesn't touch any pre-existing config — it just drops new files in `voxtra.d/`. ## Live reload [#live-reload] `TenantProvisioner.reload_asterisk(ari)` issues `PUT /ari/asterisk/modules/{module}` for `res_pjsip.so`, `pbx_config.so`, and `res_ari.so` — the three modules whose configs the provisioner touches. Per-module failures are logged and skipped; partial reloads are valid. ```python ari = ARIClient(base_url="http://pbx:8088", username="...", password="...") await ari.connect() succeeded = await provisioner.reload_asterisk(ari) # succeeded == ["res_pjsip.so", "pbx_config.so", "res_ari.so"] ``` You can also pass an explicit module list: ```python await provisioner.reload_asterisk(ari, modules=["res_pjsip.so"]) ``` ## Running the per-tenant Voxtra processes [#running-the-per-tenant-voxtra-processes] Each tenant gets its own `VoxtraApp` process — typically one container per tenant, scaled independently: ```python title="tenant-acme.py" from voxtra import VoxtraApp app = VoxtraApp( ari_url="http://pbx:8088", ari_user="voxtra-acme-corp", # the provisioned ARI user ari_password=os.environ["ARI_PW"], # store securely app_name="voxtra-acme-corp", ) @app.default() async def handle(call): ... app.run() ``` Smaller deployments can host all tenants in a single process by constructing multiple `VoxtraApp`s in the same Python program — but you give up tenant-level isolation in failure modes. ## Onboarding flow [#onboarding-flow] A typical tenant-onboarding endpoint: ### Receive the tenant signup [#receive-the-tenant-signup] User submits org name, SIP trunk credentials, DIDs. ### Construct `TenantConfig` and provision [#construct-tenantconfig-and-provision] ```python tenant = TenantConfig( tenant_id=org.slug, tenant_name=org.name, sip_trunk=SIPTrunk(host=req.trunk_host, username=req.trunk_user, password=req.trunk_pw), dids=req.dids, ) files = provisioner.provision(tenant) provisioner.write_files(files) ``` ### Reload Asterisk [#reload-asterisk] ```python await provisioner.reload_asterisk(ari) ``` ### Persist the per-tenant ARI credential [#persist-the-per-tenant-ari-credential] The provisioner generated a random ARI password — store it (encrypted) so the tenant's runtime VoxtraApp can connect. ### Spawn the tenant's runtime process [#spawn-the-tenants-runtime-process] Kubernetes Job, Cloud Run service, systemd unit — pick your deployment. The process starts with the provisioned `app_name` and ARI credential. ## Deprovisioning [#deprovisioning] Symmetric: ```python provisioner.deprovision(tenant_id="acme-corp") await provisioner.reload_asterisk(ari) # Then stop the tenant's runtime process. ``` ## Channel limits per tenant [#channel-limits-per-tenant] `TenantConfig.max_channels` controls the soft channel cap. The provisioner emits `device_state_busy_at = N` on the endpoint, which Asterisk uses for hunt-group busy signalling. Hard caps (rejecting calls beyond N) need additional dialplan logic — track it via `Set(GROUP(${TENANT_ID})=${UNIQUEID})` and check `GROUP_COUNT()`. ## Audit trail [#audit-trail] Voxtra's [BackendWebhook](/voxtra/guides/webhooks) makes multi-tenant audit straightforward — every event includes the `session_id` and you can inspect `call.metadata` for `tenant_id` (populate it from route metadata or channel variables). In production at Luso8, tenant onboarding is fully automated: an admin endpoint receives the form data, the provisioner runs, and the tenant's process is launched as a Kubernetes Deployment within 10 seconds. --- # VoxtraApp (/voxtra/reference/voxtra-app) > API reference for VoxtraApp — constructor, classmethods, decorators, and lifecycle. The orchestrator at the centre of every Voxtra application. ```python from voxtra import VoxtraApp ``` The orchestrator. Owns the telephony adapter, runs the event loop, dispatches calls to handlers, and (optionally) auto-wires the AI pipeline and webhook emitter. ## Constructor [#constructor] ```python VoxtraApp( ari_url: str = "", ari_user: str = "", ari_password: str = "", *, app_name: str = "voxtra", reconnect_interval: float = 5.0, debug: bool = False, router: Router | None = None, telephony: BaseTelephonyAdapter | None = None, stt: BaseSTT | None = None, llm: BaseAgent | None = None, tts: BaseTTS | None = None, vad: BaseVAD | None = None, webhook: BackendWebhook | None = None, recording_sink: RecordingSink | None = None, ) ``` | Param | Default | Notes | | -------------------- | ------------------ | ------------------------------------------------------------------ | | `ari_url` | `$VOXTRA_ARI_URL` or `http://localhost:8088` | Asterisk REST URL. Used only when `telephony` is None. | | `ari_user` | `$VOXTRA_ARI_USER` or `asterisk` | ARI username. | | `ari_password` | `$VOXTRA_ARI_PASSWORD` | ARI password. | | `app_name` | `voxtra` | Stasis app name. **Must be unique per tenant** in multi-tenant deployments. | | `reconnect_interval` | `5.0` seconds | Backoff between WS reconnect attempts. | | `debug` | `False` | Enable DEBUG-level logging. | | `router` | new `Router()` | Pass an existing router for advanced composition. | | `telephony` | lazy `AsteriskAdapter` | Inject a custom adapter (e.g. `LiveKitAdapter`). | | `stt` / `llm` / `tts` / `vad` | None | When all three of stt/llm/tts are set, every session gets an auto-wired pipeline. | | `webhook` | None | Configure to fan events out to your backend. | | `recording_sink` | None | Default sink for `record_start()`. Per-call override available. | ## Classmethods [#classmethods] ### `with_asterisk()` [#with_asterisk] Sugar for "give me a Voxtra app with an Asterisk backend": ```python app = VoxtraApp.with_asterisk( ari_url="http://pbx:8088", ari_user="asterisk", ari_password="secret", app_name="voxtra-acme", ) ``` Equivalent to `VoxtraApp(telephony=AsteriskAdapter(...))`. ### `from_config(VoxtraConfig)` [#from_configvoxtraconfig] Build from a Pydantic config object. The telephony adapter is resolved from the registry by name. AI providers are *not* auto-instantiated — you pass them in or build them post-construction. When `config.backend.webhook.url` is set, a `BackendWebhook` is constructed automatically. ```python from voxtra.config import VoxtraConfig config = VoxtraConfig.from_yaml("voxtra.yaml") app = VoxtraApp.from_config(config) ``` ### `from_yaml(path)` [#from_yamlpath] Shortcut for `from_config(VoxtraConfig.from_yaml(path))`. ```python app = VoxtraApp.from_yaml("voxtra.yaml") ``` This is what `voxtra start -c voxtra.yaml` uses internally. ## Decorators [#decorators] ### `@app.route()` [#approute] Register a static-route handler: ```python @app.route(extension="1000") async def support(call): ... @app.route(number="+265888111111", metadata={"vip": True}) async def vip(call): ... ``` Parameters: `extension`, `number`, `name`, `metadata`. Metadata is merged into `call.metadata` when the route fires. ### `@app.default()` [#appdefault] Register the fallback handler: ```python @app.default() async def fallback(call): ... ``` `@app.default_route()` is an alias preserved for backward compat. ### `@app.on_call()` (deprecated) [#appon_call-deprecated] Replaced by `@app.route()` and `@app.default()`. Still works for one more minor version, with a `DeprecationWarning`. ### `@app.on_startup()` / `@app.on_shutdown()` [#appon_startup--appon_shutdown] Register async lifecycle hooks: ```python @app.on_startup async def init(): await db.connect() @app.on_shutdown async def cleanup(): await db.close() ``` ## Outbound calling [#outbound-calling] ### `originate(endpoint, *, caller_id="", timeout=30, variables=None)` [#originateendpoint--caller_id-timeout30-variablesnone] Originate an outbound call into the configured Stasis app: ```python call = await app.originate( endpoint="PJSIP/+265999@my-trunk", caller_id="+265888000001", timeout=30, variables={"PURPOSE": "appointment_confirmation"}, ) await call.answer() await call.say("Hi, this is Acme calling.") ``` Returns a `CallSession`. For dialplan-mode origination (so existing dialplan logic fires), use `app.ari.originate(... context=..., extension=...)` directly — see [`ARIClient.originate`](/voxtra/reference/ari-client#originate). ## Lifecycle [#lifecycle] ### `start()` [#start] Async start. Connects the telephony adapter, runs startup hooks, begins dispatching events. Blocks until `stop()` is called. ```python async def main(): await app.start() asyncio.run(main()) ``` ### `stop()` [#stop] Graceful shutdown. Hangs up active sessions, disconnects the adapter, closes the webhook HTTP client, runs shutdown hooks. ```python await app.stop() ``` ### `run()` [#run] Blocking helper for standalone applications. Sets up SIGINT/SIGTERM handlers and calls `start()` in a fresh event loop. ```python app.run() ``` ### `run_async()` [#run_async] Use when integrating with an existing async app (e.g. a FastAPI server). Equivalent to `await app.start()`. ```python async def main(): await app.run_async() ``` ## Session management [#session-management] ### `app.active_sessions` [#appactive_sessions] A snapshot dict (`channel_id → CallSession`) of every currently active session. Read-only (mutating it doesn't affect the framework's own session map). ### `app.get_session(session_id)` [#appget_sessionsession_id] Look up a session by its ID. Returns `None` if not present. ## Properties [#properties] | Property | Type | Notes | | -------------------- | ----------------------------- | ---------------------------------------------- | | `app.app_name` | `str` | Stasis app name. | | `app.router` | `Router` | The active router. | | `app.telephony` | `BaseTelephonyAdapter` | The active backend (lazy-built `AsteriskAdapter` if not provided). | | `app.ari` | `ARIClient` | The underlying ARI client. Raises if not connected. | | `app.is_running` | `bool` | True between `start()` and `stop()`. | ## CLI: `voxtra start` [#cli-voxtra-start] If you `pip install voxtra`, the `voxtra` CLI is on your PATH: ```bash voxtra start -c voxtra.yaml voxtra check # validate config + connectivity voxtra info # print version + provider list voxtra init # scaffold a new app ``` `voxtra start` is `VoxtraApp.from_yaml(path).run()` under the hood. --- # ARIClient (/voxtra/reference/ari-client) > Low-level Asterisk REST Interface client. HTTP control + WebSocket events, with typed wrappers for every common operation. ```python from voxtra import ARIClient ``` The lowest layer. A direct, async wrapper around Asterisk's [REST Interface](https://wiki.asterisk.org/wiki/display/AST/Asterisk+REST+Interface) — HTTP for control plane, WebSocket for events. You don't usually construct this yourself; `VoxtraApp` does it for you and exposes it as `app.ari`. Reach for it when you need a raw ARI verb that Voxtra hasn't wrapped at a higher level. ## Constructor [#constructor] ```python ARIClient( base_url: str, username: str, password: str, *, app_name: str = "voxtra", reconnect_interval: float = 5.0, ) ``` | Param | Notes | | ------------- | -------------------------------------------------------------- | | `base_url` | E.g. `http://pbx:8088`. WebSocket URL is derived from this. | | `username` | ARI username. | | `password` | ARI password. | | `app_name` | Default Stasis app for `originate()`, `snoop_channel()`, etc. | | `reconnect_interval` | WS reconnect backoff in seconds. | ## Connection [#connection] ### `connect()` [#connect] Open the HTTP client and ping `/ari/asterisk/info`. Returns the system-info dict. ```python ari = ARIClient(base_url="http://pbx:8088", username="...", password="...") info = await ari.connect() print(info["system"]["version"]) ``` `connect()` is **idempotent** — calling it on an already-connected client returns the cached info dict. ### `close()` / context manager [#close--context-manager] ```python async with ARIClient(...) as ari: await ari.list_channels() # auto-closes ``` ### `is_connected: bool` [#is_connected-bool] True after a successful `connect()`, False otherwise. ## Event stream [#event-stream] ### `events() → AsyncIterator[ARIEvent]` [#events--asynciteratorarievent] Subscribe to the Stasis WebSocket. Yields parsed `ARIEvent`s until the WS closes: ```python async for event in ari.events(): if event.type == "StasisStart": ... elif event.type == "ChannelDtmfReceived": ... ``` Auto-reconnects on disconnect with `reconnect_interval` backoff. `VoxtraApp` consumes this iterator internally; you only use it directly when bypassing the framework. ## Channels [#channels] ### `originate(endpoint, *, app=None, context=None, extension=None, priority=None, caller_id="", timeout=30, variables=None, channel_id=None) → Channel` [#originate] Create an outbound call. Two routing modes: **Stasis routing** (default): ```python channel = await ari.originate( "PJSIP/+265999@my-trunk", caller_id="+265888000001", timeout=30, ) ``` The call lands directly in `app_name`'s Stasis app on answer. **Dialplan routing**: ```python channel = await ari.originate( "PJSIP/+265999@my-trunk", app=None, # explicit: no Stasis context="from-trunk-out", extension="+265999", caller_id="+265888000001", variables={"MY_CALL_ID": "abc-123"}, ) ``` The call enters the dialplan as if it had arrived via SIP. Use this mode when existing dialplan logic needs to fire. ### `answer_channel(channel_id)` [#answer_channelchannel_id] ```python await ari.answer_channel(channel.id) ``` ### `hangup_channel(channel_id, reason="normal")` [#hangup_channelchannel_id-reasonnormal] ```python await ari.hangup_channel(channel.id, reason="normal_clearing") ``` ### `get_channel(channel_id) → Channel` [#get_channelchannel_id--channel] ### `list_channels() → list[Channel]` [#list_channels--listchannel] ### `redirect_channel(channel_id, endpoint)` [#redirect_channelchannel_id-endpoint] Blind transfer the channel to a new SIP endpoint. ### `set_channel_var(channel_id, variable, value)` [#set_channel_varchannel_id-variable-value] Set an Asterisk channel variable. The dialplan can `${VARIABLE}` to read it. ### `send_dtmf(channel_id, dtmf)` [#send_dtmfchannel_id-dtmf] Inject DTMF tones (`"1234#"`) onto the channel. ### `moh_start(channel_id, moh_class="default")` / `moh_stop(channel_id)` [#moh_startchannel_id-moh_classdefault--moh_stopchannel_id] Music on hold. ### `snoop_channel(channel_id, *, app=None, spy="both", whisper="none") → Channel` [#snoop_channelchannel_id--appnone-spyboth-whispernone--channel] Create a snoop leg for monitoring or whispering. Returns the snoop channel, which you can route into your Stasis app for processing (e.g. live transcription). ### `create_external_media(...)` [#create_external_media] Create an external-media channel for RTP-based audio injection. See the [Voxtra source](https://github.com/rexplore-ai/voxtra/blob/main/src/voxtra/ari/client.py) for parameter details. ## Bridges [#bridges] ```python bridge = await ari.create_bridge(bridge_type="mixing", name="acme-conf") await ari.add_to_bridge(bridge.id, [channel1.id, channel2.id]) await ari.remove_from_bridge(bridge.id, [channel2.id]) await ari.destroy_bridge(bridge.id) ``` ## Playback [#playback] ```python playback = await ari.play_on_channel(channel.id, media="sound:hello-world") await ari.stop_playback(playback.id) ``` ## Recording [#recording] ```python await ari.record_channel(channel.id, name="my-recording", fmt="wav") await ari.stop_recording("my-recording") ``` For recordings, prefer the higher-level [`CallSession.record_start`](/voxtra/reference/call-session) — it wires the [`RecordingSink`](/voxtra/reference/recording) for you. ## Module / config management [#module--config-management] ### `reload_module(module_name)` [#reload_modulemodule_name] `PUT /ari/asterisk/modules/{module}` — live-reload an Asterisk module without `asterisk -rx` or SSH. ```python await ari.reload_module("res_pjsip.so") await ari.reload_module("pbx_config.so") ``` Used by `TenantProvisioner.reload_asterisk()` after writing tenant config fragments. ### `list_modules() → list[dict]` [#list_modules--listdict] `GET /ari/asterisk/modules` — list all loaded modules. ## Raw helpers [#raw-helpers] For ARI endpoints Voxtra hasn't wrapped, use the raw HTTP helpers: ```python data = await ari._get("/ari/recordings/stored/my-recording") await ari._post(f"/ari/channels/{channel.id}/play", params={"media": "..."}) await ari._put(f"/ari/asterisk/modules/res_pjsip.so") await ari._delete(f"/ari/recordings/stored/my-recording") ``` These are documented as private (`_`-prefixed) but are stable — they won't change without a major version bump. ## Models [#models] The ARI client returns typed Pydantic models for the common resources: - `voxtra.ari.models.Channel` - `voxtra.ari.models.Bridge` - `voxtra.ari.models.Playback` Each has a `.from_ari(data)` classmethod that parses the raw ARI JSON. ## Event types [#event-types] Events from `ari.events()` are `ARIEvent`s, with subclasses for each event type. Common ones: - `StasisStart` — call entered the Stasis app. - `StasisEnd` — call left. - `ChannelDtmfReceived` — `event.digit`. - `ChannelHangupRequest` / `ChannelDestroyed` — hangup signals. - `RecordingFinished` — recording stopped. See [`voxtra/ari/events.py`](https://github.com/rexplore-ai/voxtra/blob/main/src/voxtra/ari/events.py) for the full taxonomy. --- # CallSession (/voxtra/reference/call-session) > API reference for CallSession — the developer-facing handle for an active call. Lifecycle, audio I/O, DTMF, recording, and AI shortcuts. ```python from voxtra import CallSession # only for type hints ``` The handle your handler receives. You don't construct these yourself; `VoxtraApp` does it for every inbound call and every successful `originate()`. ## Attributes [#attributes] | Attribute | Type | Notes | | -------------------- | ------------------- | -------------------------------------------------- | | `call.id` | `str` | Same as Asterisk channel ID. | | `call.caller_id` | `str` | Calling party number. | | `call.called_number` | `str` | Dialed extension or DID. | | `call.direction` | `CallDirection` | `INBOUND` or `OUTBOUND`. | | `call.state` | `CallState` | `RINGING`, `IN_PROGRESS`, `ON_HOLD`, `COMPLETED`, `FAILED`. | | `call.metadata` | `dict` | Arbitrary store. Pre-filled with route metadata. | | `call.duration` | `float` | Seconds since `answer()`. 0 before answer. | | `call.app_name` | `str` | Owning `VoxtraApp`'s `app_name`. | | `call.agent` | `AgentClient` | LLM conversation handle (when AI pipeline configured). | ## Lifecycle [#lifecycle] ### `await call.answer()` [#await-callanswer] 200 OK the call. State transitions to `IN_PROGRESS`. `call.duration` starts counting. ### `await call.hangup()` [#await-callhangup] Tear down the channel. Idempotent — calling it twice is fine. Triggers `on_hangup` callbacks. ### `await call.hold()` / `await call.unhold()` [#await-callhold--await-callunhold] Music-on-hold the far end. ### `await call.transfer_to(endpoint)` [#await-calltransfer_toendpoint] Blind transfer the call to a new endpoint: ```python await call.transfer_to("PJSIP/agent-001@internal") ``` ## Audio I/O [#audio-io] ### `await call.play_file(filename)` [#await-callplay_filefilename] Play an Asterisk-bundled prompt: ```python await call.play_file("hello-world") # sound:hello-world await call.play_file("sound:hello-world") # explicit prefix ``` ### `await call.say(text, *, interruptible=True)` [#await-callsaytext--interruptibletrue] Synthesize text via the configured TTS and play it back. Returns when the speech ends (or earlier if interrupted by barge-in, when `interruptible=True`). ```python await call.say("Welcome to Acme.") ``` Raises `RuntimeError("AI pipeline not configured")` if no TTS is set. ### `async for chunk in call.audio_stream():` [#async-for-chunk-in-callaudio_stream] Iterate raw inbound audio frames: ```python async for chunk in call.audio_stream(): # chunk: AudioChunk (μ-law by default, ~20ms) processed = my_dsp(chunk) await call.send_audio(processed) ``` ### `await call.send_audio(chunk)` [#await-callsend_audiochunk] Send a frame to the far end. ## DTMF [#dtmf] ### `await call.listen_dtmf(timeout=None) → str | None` [#await-calllisten_dtmftimeoutnone--str--none] Wait for a single DTMF digit: ```python digit = await call.listen_dtmf(timeout=5) if digit == "1": ... ``` Returns `None` on timeout. ### `await call.send_dtmf(dtmf)` [#await-callsend_dtmfdtmf] Send DTMF tones to the far end (typically for navigating downstream IVRs): ```python await call.send_dtmf("4321#") ``` ## Recording [#recording] ### `await call.record_start(name="", fmt="wav", *, sink=None) → str` [#await-callrecord_startname-fmtwav--sinknone--str] Start recording the call. Returns the recording name. ```python name = await call.record_start() # auto-generated name name = await call.record_start("acme-call-001") # explicit name name = await call.record_start(sink=GCSSink(...)) # per-call sink ``` Without `sink=`, the recording uses the app-level default (`VoxtraApp(recording_sink=...)`) or `LocalFileSink` if neither is set. ### `await call.record_stop() → str | None` [#await-callrecord_stop--str--none] Stop the recording. Fires the configured `RecordingSink` exactly once with a `RecordingMetadata` object. Returns the recording name, or `None` if no recording was active. ```python await call.record_stop() ``` ## Bridging [#bridging] ### `await call.bridge_with(other: CallSession) → str` [#await-callbridge_withother-callsession--str] Create a mixing bridge between two sessions. Both calls share audio: ```python async def transfer_to_agent(ai_call, agent_call): await ai_call.bridge_with(agent_call) ``` Returns the bridge ID. ### `await call.transfer_to_queue(queue_name)` [#await-calltransfer_to_queuequeue_name] Send the call into an Asterisk queue. ## AI shortcuts [#ai-shortcuts] Available when `VoxtraApp` is constructed with `stt=`, `llm=`, and `tts=`. ### `await call.say(text)` [#await-callsaytext] (See above under Audio I/O.) ### `await call.listen(timeout=None) → UserTranscriptEvent | None` [#await-calllistentimeoutnone--usertranscriptevent--none] Wait for a final user transcript. Returns `None` on timeout. Partial transcripts are filtered out — you only see finals. ```python user = await call.listen(timeout=10) if user: print(user.text, user.confidence) ``` ### `call.agent.respond(text) → AgentResponseEvent` [#callagentrespondtext--agentresponseevent] Single-turn LLM call with running conversation history: ```python reply = await call.agent.respond(user.text) print(reply.text, reply.tool_calls) ``` ### `call.agent.history` [#callagenthistory] The conversation messages list. Mutate it to seed context or replay prior turns: ```python call.agent.history.append({"role": "user", "content": "Hi from earlier."}) ``` ### `call.agent.add_tool_result(tool_id, result)` [#callagentadd_tool_resulttool_id-result] Feed a tool-call result back to the LLM: ```python await call.agent.add_tool_result(tool_id="t-1", result="Order #4321 shipped 2026-05-04") reply = await call.agent.respond("") ``` ## Callbacks [#callbacks] ### `@call.on_hangup` [#callon_hangup] Register an async callback that fires exactly once when the call hangs up: ```python @call.on_hangup async def cleanup(): await save_transcript(call.id, call.agent.history) ``` Multiple callbacks can be registered; they fire in registration order. ## Internals (advanced) [#internals-advanced] These are exposed but not part of the stable public API. - `call._event_queue` — the underlying `asyncio.Queue[VoxtraEvent]`. - `call._dtmf_queue` — DTMF-specific queue. - `call._ari` — the `ARIClient` instance backing this session (may be None). - `call._pipeline` — the auto-wired `VoicePipeline` (if any). - `call._default_recording_sink` — the app-level sink populated by `VoxtraApp`. Use sparingly — these are subject to internal refactors between minor versions. --- # BackendWebhook (/voxtra/reference/webhooks) > API reference for the BackendWebhook emitter and the WebhookConfig model. HTTP delivery of every VoxtraEvent to your backend. ```python from voxtra import BackendWebhook from voxtra.config import WebhookConfig ``` Async HTTP emitter for `VoxtraEvent`s. Fire-and-forget delivery with HMAC signing, retries, and per-event-type filtering. ## `WebhookConfig` [#webhookconfig] ```python class WebhookConfig(BaseModel): url: str = "" signing_secret: str = "" events: list[str] = [] timeout_seconds: float = 10.0 max_retries: int = 3 retry_backoff: float = 1.0 ``` | Field | Default | Notes | | ---------------- | ------- | -------------------------------------------------------- | | `url` | `""` | Empty string disables emission. | | `signing_secret` | `""` | When set, every request includes `X-Voxtra-Signature`. | | `events` | `[]` | Allowlist of event-type strings. Empty list = all events. | | `timeout_seconds`| `10.0` | Per-request HTTP timeout. | | `max_retries` | `3` | Retries on 5xx / transport errors. | | `retry_backoff` | `1.0` | Initial backoff in seconds; doubles each attempt. | ## Constructor [#constructor] ```python BackendWebhook( config: WebhookConfig, *, http_client: httpx.AsyncClient | None = None, ) ``` When `http_client` is `None`, the emitter creates and owns an `httpx.AsyncClient` (closed on `aclose()` / `app.stop()`). Pass an external client to share it across emitters or other code — Voxtra will not close clients it doesn't own. ## Methods [#methods] ### `await webhook.emit(event: VoxtraEvent) → bool` [#await-webhookemitevent-voxtraevent--bool] Deliver a single event. Returns `True` on a 2xx response (within the retry budget), `False` otherwise. Failures are swallowed and logged at WARNING — `emit` never raises. ```python await webhook.emit(some_event) ``` You typically don't call this yourself — `VoxtraApp` calls it automatically when a `webhook=` is configured. ### `await webhook.aclose()` [#await-webhookaclose] Close the underlying HTTP client (only if owned). ## Behaviour [#behaviour] ### Signature [#signature] When `signing_secret` is set, the request includes: ``` X-Voxtra-Signature: ``` The hex digest is computed over the **raw request body** (the canonical JSON, with `","` and `":"` separators — no whitespace). ### Headers [#headers] Every request includes: | Header | Value | | --------------------- | ------------------------------------------------ | | `Content-Type` | `application/json` | | `User-Agent` | `voxtra-webhook/1` | | `X-Voxtra-Event` | The `event.type` string | | `X-Voxtra-Event-Id` | The `event.id` (use as idempotency key) | | `X-Voxtra-Session-Id` | The `event.session_id` | | `X-Voxtra-Signature` | HMAC-SHA256 (when secret set) | ### Retry policy [#retry-policy] | Outcome | Behaviour | | ----------------- | ------------------------------------------ | | 2xx | Done. | | 4xx | Drop, log at WARNING — no retry. | | 5xx | Retry up to `max_retries` times. | | Transport error | Retry up to `max_retries` times. | | Retry budget exhausted | Drop, log at WARNING. | Backoff is exponential — `retry_backoff`, then `2×`, then `4×`, etc. ### Filtering [#filtering] `events=[]` (default) emits every event. To restrict: ```python WebhookConfig( url="...", events=[ "call.started", "call.ended", "user.transcript", # finals only — partials have a different type ], ) ``` The string values are the `EventType` enum values (e.g. `call.started`, not `CALL_STARTED`). ## Wiring into `VoxtraApp` [#wiring-into-voxtraapp] ### Constructor parameter [#constructor-parameter] ```python from voxtra import VoxtraApp, BackendWebhook from voxtra.config import WebhookConfig webhook = BackendWebhook(WebhookConfig(url="https://api.example.com/webhooks/voxtra")) app = VoxtraApp(..., webhook=webhook) ``` ### Auto-built from config [#auto-built-from-config] `VoxtraApp.from_config(VoxtraConfig)` (and `from_yaml`) auto-build a `BackendWebhook` when `config.backend.webhook.url` is set: ```yaml title="voxtra.yaml" app_name: voxtra-acme telephony: provider: asterisk asterisk: base_url: http://pbx:8088 username: voxtra-acme password: ${ARI_PW} backend: webhook: url: https://api.example.com/webhooks/voxtra signing_secret: ${WEBHOOK_SECRET} events: - call.started - call.ended ``` ```python app = VoxtraApp.from_yaml("voxtra.yaml") # app._webhook is a BackendWebhook configured from the YAML ``` ## Receiver examples [#receiver-examples] See the [Webhooks guide](/voxtra/guides/webhooks) for FastAPI, Express, and Go receiver examples with signature verification. --- # RecordingSink (/voxtra/reference/recording) > API reference for the recording sink abstraction — RecordingSink ABC, RecordingMetadata, and the built-in LocalFileSink, WebhookSink, and CompositeSink implementations. ```python from voxtra.recording import ( RecordingSink, RecordingMetadata, LocalFileSink, WebhookSink, CompositeSink, ) # Also re-exported from the top-level package: from voxtra import RecordingSink, WebhookSink ``` Pluggable destinations for finished call recordings. Voxtra writes recordings via Asterisk; what's pluggable is **what happens after the recording stops**. ## `RecordingMetadata` [#recordingmetadata] ```python @dataclass class RecordingMetadata: session_id: str name: str file_path: str = "" duration_seconds: float | None = None format: str = "wav" extra: dict[str, Any] = field(default_factory=dict) ``` | Field | Notes | | ------------------ | ------------------------------------------------------------ | | `session_id` | The owning `CallSession.id`. | | `name` | Recording name passed to `record_start`. | | `file_path` | Best-effort guess — `/var/spool/asterisk/recording/{name}.{format}`. | | `duration_seconds` | Wall-clock seconds between start and stop (None if unknown). | | `format` | Audio format (e.g. `wav`, `gsm`). | | `extra` | Arbitrary key-value extension data. | ## `RecordingSink` (ABC) [#recordingsink-abc] ```python class RecordingSink(ABC): @abstractmethod async def on_recording_complete(self, metadata: RecordingMetadata) -> None: ... ``` Implementations should be **idempotent** — sinks may be invoked more than once for the same recording during reconnects or retries. Implementations should **never raise into the call pipeline**. The framework wraps every call in a try/except as a safety net, but well-behaved sinks catch their own errors and log them. ## `LocalFileSink` [#localfilesink] ```python LocalFileSink(base_dir: str | Path = "/var/spool/asterisk/recording") ``` Default no-op sink — logs a debug line and exits. Use as a placeholder when recording is on but you don't yet have an upload path. ```python from voxtra.recording import LocalFileSink app = VoxtraApp(..., recording_sink=LocalFileSink()) ``` ## `WebhookSink` [#webhooksink] ```python WebhookSink( url: str, *, signing_secret: str = "", timeout_seconds: float = 10.0, http_client: httpx.AsyncClient | None = None, ) ``` POSTs the recording metadata as JSON to `url`. The receiver fetches the audio (via Asterisk's HTTP recording endpoint, `scp`, or other means) and uploads it to long-term storage. ```python from voxtra.recording import WebhookSink sink = WebhookSink( "https://api.example.com/webhooks/recording", signing_secret="please-rotate-me", ) ``` ### Payload [#payload] ```json { "session_id": "ch-1234", "name": "voxtra-rec-...", "file_path": "/var/spool/asterisk/recording/voxtra-rec-....wav", "duration_seconds": 42.3, "format": "wav", "extra": {} } ``` ### Headers [#headers] | Header | Value | | --------------------- | ------------------------------------ | | `Content-Type` | `application/json` | | `X-Voxtra-Signature` | `hmac_sha256(secret, body)` (when secret set) | ### `await sink.aclose()` [#await-sinkaclose] Close the underlying HTTP client (only if owned). ## `CompositeSink` [#compositesink] ```python CompositeSink(*sinks: RecordingSink) ``` Fan a single recording event out to multiple sinks. Per-sink errors are isolated, so a slow or broken sink can't starve the others. ```python from voxtra.recording import CompositeSink, WebhookSink, LocalFileSink sink = CompositeSink( LocalFileSink(), WebhookSink("https://crm.example.com/recordings"), WebhookSink("https://archive.example.com/recordings"), ) ``` ## Custom sinks [#custom-sinks] Any class that implements `on_recording_complete(metadata)` works: ```python from voxtra.recording import RecordingSink, RecordingMetadata class MySink(RecordingSink): async def on_recording_complete(self, metadata: RecordingMetadata) -> None: # Upload to your storage, kick off transcription, ... ... ``` For a working GCS implementation, see the [Recording guide](/voxtra/guides/recording#custom-sinks). ## Wiring [#wiring] ### App-level default [#app-level-default] ```python app = VoxtraApp(..., recording_sink=my_sink) ``` Every session inherits this sink. Set on the app, not per-session, when you want all recordings to follow the same pipeline. ### Per-call override [#per-call-override] ```python @app.default() async def handle(call): await call.answer() await call.record_start(sink=PrioritySink()) # overrides the app default ... await call.record_stop() ``` ### Lifecycle [#lifecycle] | Phase | Sink behaviour | | ---------------- | ------------------------------------------------------------- | | `record_start()` | Sink is captured but not invoked. | | Mid-call | Sink is dormant. | | `record_stop()` | Sink is invoked once with `RecordingMetadata`. | | Hangup mid-recording | If recording is still active, framework calls `record_stop` (and the sink) as part of cleanup. | --- # TenantProvisioner (/voxtra/reference/provisioning) > API reference for TenantProvisioner — generates Asterisk config fragments for multi-tenant SaaS deployments and triggers live reload via ARI. ```python from voxtra.provisioning.provisioner import ( TenantConfig, TenantProvisioner, ) from voxtra.types import SIPTrunk ``` Generates per-tenant Asterisk configuration fragments and triggers live reloads via ARI. The primary primitive for hosting multi-tenant SaaS on a shared Asterisk cluster. For the conceptual overview, see the [Multi-tenant guide](/voxtra/guides/multi-tenant). ## `TenantConfig` [#tenantconfig] The input model. One per tenant. ```python class TenantConfig(BaseModel): tenant_id: str tenant_name: str = "" ari_app_name: str = "" # auto-generated if empty ari_username: str = "" # auto-generated if empty ari_password: str = "" # auto-generated if empty (32-char random) sip_trunk: SIPTrunk | None = None dids: list[str] = [] # DIDs assigned to this tenant context: str = "" # dialplan context, auto-generated if empty max_channels: int = 10 # soft channel cap audiosocket_host: str = "127.0.0.1" audiosocket_port: int = 0 # 0 = auto-assign ``` Auto-generated names follow the pattern `voxtra-{tenant_id}` for the ARI app and username, and `voxtra-{tenant_id}-inbound` for the dialplan context. ```python config = TenantConfig(tenant_id="acme-corp") config.ari_app_name # "voxtra-acme-corp" config.ari_username # "voxtra-acme-corp" config.context # "voxtra-acme-corp-inbound" ``` ## `SIPTrunk` [#siptrunk] ```python class SIPTrunk(BaseModel): host: str username: str password: str port: int = 5060 transport: str = "udp" # udp | tcp | tls realm: str = "" codecs: list[str] = [] did: str = "" # caller-ID for outbound ``` ## `TenantProvisioner` [#tenantprovisioner] ### Constructor [#constructor] ```python TenantProvisioner(output_dir: str | Path = "/etc/asterisk/voxtra.d") ``` `output_dir` is where the generated `.conf` fragments are written. Your top-level Asterisk configs `#include` files in this directory. ### `provision(tenant: TenantConfig) → dict[str, str]` [#provisiontenant-tenantconfig--dictstr-str] Generate the fragments. Returns a dict mapping filename to content. **Does not write to disk** — pair with `write_files()`. ```python files = provisioner.provision(tenant) # files == { # "ari_acme-corp.conf": "...", # "pjsip_acme-corp.conf": "...", # only if sip_trunk set # "extensions_acme-corp.conf": "...", # } ``` ### `write_files(files: dict[str, str]) → list[Path]` [#write_filesfiles-dictstr-str--listpath] Write the fragments to `output_dir`. Creates the directory if missing. Returns the paths of the written files. ```python paths = provisioner.write_files(files) # paths == [ # Path("/etc/asterisk/voxtra.d/ari_acme-corp.conf"), # Path("/etc/asterisk/voxtra.d/pjsip_acme-corp.conf"), # Path("/etc/asterisk/voxtra.d/extensions_acme-corp.conf"), # ] ``` ### `deprovision(tenant_id: str) → list[Path]` [#deprovisiontenant_id-str--listpath] Remove the fragments for a tenant. Returns the paths that were deleted. Safe to call when files don't exist (returns empty list). ```python removed = provisioner.deprovision("acme-corp") ``` ### `await reload_asterisk(ari, modules=None) → list[str]` [#await-reload_asteriskari-modulesnone--liststr] Reload Asterisk so the new fragments take effect. Issues `PUT /ari/asterisk/modules/{module}` for each module — by default `res_pjsip.so`, `pbx_config.so`, and `res_ari.so` (the three modules whose configs the provisioner touches). ```python ari = ARIClient(base_url="http://pbx:8088", username="...", password="...") await ari.connect() succeeded = await provisioner.reload_asterisk(ari) # succeeded == ["res_pjsip.so", "pbx_config.so", "res_ari.so"] ``` Per-module failures are logged at WARNING and skipped — partial reloads are valid. The method returns the list of modules that reloaded successfully. To reload only specific modules: ```python await provisioner.reload_asterisk(ari, modules=["res_pjsip.so"]) ``` ### `DEFAULT_RELOAD_MODULES` [#default_reload_modules] Class constant — the default module list for `reload_asterisk()`. ```python TenantProvisioner.DEFAULT_RELOAD_MODULES # ("res_pjsip.so", "pbx_config.so", "res_ari.so") ``` ## File layout [#file-layout] After provisioning two tenants, `output_dir` looks like: ``` /etc/asterisk/voxtra.d/ ├── ari_acme-corp.conf ├── ari_beta-inc.conf ├── extensions_acme-corp.conf ├── extensions_beta-inc.conf ├── pjsip_acme-corp.conf └── pjsip_beta-inc.conf ``` Top-level `extensions.conf`, `pjsip.conf`, and `ari.conf` use glob includes: ```ini title="/etc/asterisk/extensions.conf" #include "voxtra.d/extensions_*.conf" ``` ```ini title="/etc/asterisk/pjsip.conf" #include "voxtra.d/pjsip_*.conf" ``` ```ini title="/etc/asterisk/ari.conf" #include "voxtra.d/ari_*.conf" ``` ## Generated content [#generated-content] ### `ari_{slug}.conf` [#ari_slugconf] ```ini ; Voxtra ARI user for tenant: ACME Corp ; Auto-generated — do not edit manually [voxtra-acme-corp] type = user read_only = no password = password_format = plain ``` ### `pjsip_{slug}.conf` [#pjsip_slugconf] ```ini ; Voxtra SIP trunk for tenant: ACME Corp [voxtra-acme-corp-trunk-auth] type = auth auth_type = userpass username = acme password = s3cret realm = sip.carrier.com [voxtra-acme-corp-trunk-aor] type = aor contact = sip:sip.carrier.com:5060 qualify_frequency = 60 [voxtra-acme-corp-trunk] type = endpoint transport = transport-udp context = voxtra-acme-corp-inbound disallow = all allow = ulaw/alaw outbound_auth = voxtra-acme-corp-trunk-auth aors = voxtra-acme-corp-trunk-aor direct_media = no rtp_symmetric = yes force_rport = yes rewrite_contact = yes [voxtra-acme-corp-trunk-reg] type = registration transport = transport-udp outbound_auth = voxtra-acme-corp-trunk-auth server_uri = sip:sip.carrier.com:5060 client_uri = sip:acme@sip.carrier.com:5060 retry_interval = 60 expiration = 3600 [voxtra-acme-corp-trunk-identify] type = identify endpoint = voxtra-acme-corp-trunk match = sip.carrier.com ``` ### `extensions_{slug}.conf` [#extensions_slugconf] ```ini ; Voxtra dialplan for tenant: ACME Corp [voxtra-acme-corp-inbound] exten => _X.,1,NoOp(Voxtra inbound for tenant acme-corp) same => n,Stasis(voxtra-acme-corp) same => n,Hangup() exten => 265999123456,1,NoOp(Voxtra DID +265999123456 for tenant acme-corp) same => n,Stasis(voxtra-acme-corp) same => n,Hangup() [voxtra-acme-corp-queues] exten => _X.,1,NoOp(Voxtra queue handoff for acme-corp) same => n,Queue(${EXTEN}) same => n,Hangup() [voxtra-acme-corp-outbound] exten => _+X.,1,NoOp(Voxtra outbound for acme-corp) same => n,Dial(PJSIP/${EXTEN}@voxtra-acme-corp-trunk,30) same => n,Hangup() ``` ## End-to-end flow [#end-to-end-flow] ```python from voxtra import ARIClient from voxtra.provisioning.provisioner import TenantConfig, TenantProvisioner from voxtra.types import SIPTrunk # 1. Build the tenant config from your signup form / API request. tenant = TenantConfig( tenant_id="acme-corp", tenant_name="ACME Corp", sip_trunk=SIPTrunk( host="sip.carrier.com", username="acme", password=os.environ["ACME_TRUNK_PW"], did="+265999123456", ), dids=["+265999123456"], max_channels=20, ) # 2. Provision config fragments. provisioner = TenantProvisioner(output_dir="/etc/asterisk/voxtra.d") files = provisioner.provision(tenant) provisioner.write_files(files) # 3. Live-reload Asterisk via ARI. ari = ARIClient( base_url="http://pbx:8088", username=os.environ["ADMIN_ARI_USER"], password=os.environ["ADMIN_ARI_PW"], ) await ari.connect() await provisioner.reload_asterisk(ari) # 4. Persist tenant.ari_password somewhere safe — your runtime # VoxtraApp will need it. await db.tenants.set_ari_credentials( tenant_id=tenant.tenant_id, ari_user=tenant.ari_username, ari_password=tenant.ari_password, # encrypt at rest app_name=tenant.ari_app_name, ) # 5. Spawn the tenant runtime (k8s job, Cloud Run, systemd, ...). ``` --- # Examples (/voxtra/examples) > Working Voxtra applications — from a 10-line hello-world to a production multi-tenant SaaS deployment. The [`examples/`](https://github.com/rexplore-ai/voxtra/tree/main/examples) directory in the Voxtra repo contains complete, runnable applications. Each one is intentionally small — focused on one pattern at a time. ## Gallery [#gallery] ## Inline snippets [#inline-snippets] ### Hello, call [#hello-call] ```python from voxtra import VoxtraApp app = VoxtraApp( ari_url="http://pbx:8088", ari_user="asterisk", ari_password="secret", ) @app.default() async def handle(call): await call.answer() await call.play_file("hello-world") await call.hangup() app.run() ``` ### IVR with handoff [#ivr-with-handoff] ```python @app.default() async def menu(call): await call.answer() await call.say("Press 1 for sales, 2 for support.") digit = await call.listen_dtmf(timeout=5) if digit == "1": await call.transfer_to_queue("sales-queue") elif digit == "2": await call.transfer_to_queue("support-queue") else: await call.say("Goodbye.") await call.hangup() ``` ### Voice agent with tools [#voice-agent-with-tools] ```python from voxtra import VoxtraApp from voxtra.ai.stt.deepgram import DeepgramSTT from voxtra.ai.tts.elevenlabs import ElevenLabsTTS from voxtra.ai.llm.openai import OpenAIAgent app = VoxtraApp( ari_url="...", ari_user="...", ari_password="...", stt=DeepgramSTT(api_key="..."), llm=OpenAIAgent( api_key="...", model="gpt-4o-mini", system_prompt="You are a friendly customer-support agent for Acme.", tools=[ { "type": "function", "function": { "name": "lookup_order", "description": "Fetch order details by ID.", "parameters": { "type": "object", "properties": {"order_id": {"type": "string"}}, "required": ["order_id"], }, }, }, ], ), tts=ElevenLabsTTS(api_key="...", voice_id="..."), ) @app.default() async def handle(call): await call.answer() await call.say("Acme support — how can I help?") while call.state == "in-progress": user = await call.listen(timeout=10) if user is None: await call.say("Are you still there?") continue reply = await call.agent.respond(user.text) for tool in reply.tool_calls: if tool["name"] == "lookup_order": order = await db.fetch_order(tool["arguments"]["order_id"]) await call.agent.add_tool_result(tool["id"], result=str(order)) reply = await call.agent.respond("") await call.say(reply.text) ``` ### Outbound sales dialer [#outbound-sales-dialer] ```python async def dial_one(number, script): call = await app.originate( endpoint=f"PJSIP/{number}@my-trunk", caller_id="+265888000001", ) await call.answer() await call.say(script) user = await call.listen(timeout=15) if user and "yes" in user.text.lower(): await call.transfer_to_queue("sales-queue") else: await call.say("Thanks. Goodbye.") await call.hangup() async def dial_batch(numbers, script): sem = asyncio.Semaphore(10) async def guarded(n): async with sem: try: await dial_one(n, script) except Exception as exc: logger.warning("Failed %s: %s", n, exc) await asyncio.gather(*[guarded(n) for n in numbers]) ``` ### Multi-tenant onboarding [#multi-tenant-onboarding] ```python from voxtra import ARIClient from voxtra.provisioning.provisioner import TenantConfig, TenantProvisioner from voxtra.types import SIPTrunk provisioner = TenantProvisioner() async def onboard_tenant(form): tenant = TenantConfig( tenant_id=form.org_slug, tenant_name=form.org_name, sip_trunk=SIPTrunk( host=form.trunk_host, username=form.trunk_user, password=form.trunk_pw, did=form.primary_did, ), dids=form.dids, ) files = provisioner.provision(tenant) provisioner.write_files(files) ari = ARIClient(base_url="http://pbx:8088", username="admin", password="...") await ari.connect() await provisioner.reload_asterisk(ari) await spawn_runtime_pod(tenant) ``` ## Production reference: Luso8 [#production-reference-luso8] Voxtra powers the Luso8 Cloud call center end-to-end. Notable patterns: - **Dialplan-routed origination** so existing `LUSO8_*` channel-variable logic continues to fire on every outbound call. See [VoxtraARIClient.originate_call](https://github.com/rexplore-ai/luso8/blob/master/luso8.backend/app/services/voxtra_client.py). - **GCS recording sink** wrapping `gcs_recording_service.py` to upload to Google Cloud Storage with signed-URL playback. - **Webhook receiver** at `/webhooks/asterisk` that drives the unified `call_terminator` service — single source of truth for call-state transitions across `CallSession`, `CallLog`, and `EngageConversation` models. - **Celery reconciler** that periodically queries ARI and Telnyx APIs to heal drift between Voxtra's view of call state and Luso8's database. The full Luso8 backend is open in the [`rexplore-ai/luso8`](https://github.com/rexplore-ai/luso8) repo. ## Run the examples locally [#run-the-examples-locally] Each example is a standalone Python file: ```bash git clone https://github.com/rexplore-ai/voxtra.git cd voxtra pip install -e ".[all]" cd examples/ai_agent export DEEPGRAM_API_KEY=... export OPENAI_API_KEY=... export ELEVENLABS_API_KEY=... export VOXTRA_ARI_URL=http://pbx:8088 export VOXTRA_ARI_USER=asterisk export VOXTRA_ARI_PASSWORD=secret python main.py ``` For a complete local stack including Asterisk, see the `examples/docker-compose.yml` in the Voxtra repo. --- # About Rexplore Labs (/company/about) > Rexplore Research Labs is an AI research and product development lab focused on Reinforcement Learning, multi-agent systems, and autonomous decision-making for real-world environments.
Rexplore Research Labs Rexplore Research Labs
**Rexplore Labs** is an AI research and product development lab focused on building autonomous, learning-driven systems for real-world environments. Our work centers on **Reinforcement Learning (RL)**, **multi-agent systems**, and **scalable decision-making**, developing agents that learn through interaction, coordination, and adaptation. We combine fundamental research with product engineering to design and deploy systems that operate under real-world constraints, including limited infrastructure and high-uncertainty settings. Our research spans reinforcement learning, distributed systems, and applied AI, enabling the development of reliable and adaptive intelligent systems. At Rexplore Labs, we build systems that **explore, collaborate, and make decisions at scale**, driving practical impact across industries in Africa and globally. ## Our philosophy [#our-philosophy] Many believe AGI will emerge from scaling language models. There's no doubt these systems are powerful: they've pushed AI forward and unlocked incredible applications. But we don't believe true intelligence comes from predicting the next token or manipulating language. > **Language is not intelligence. It's a reflection of it.** Real intelligence is the ability to **understand, act, and make decisions in the world**. Today's models learn from human data. Even RLHF is still humans guiding behavior through preferences. Intelligence should not depend on imitation; it should emerge from interaction. Look at a cat. No one teaches it explicitly what is right or wrong. It learns by acting, observing outcomes, and adapting its behavior. *That* is intelligence. That's why at Rexplore Research Labs we focus on advancing reinforcement learning and autonomous agents: not just models that talk, but systems that learn, adapt, and operate in the real world. ```mermaid flowchart LR Observe["Observe
Read state from environment"] Decide["Decide
Policy maps state → action"] Act["Act
Apply action; world changes"] Learn["Learn
Update policy from reward"] Observe --> Decide Decide --> Act Act --> Learn Learn --> Observe classDef step fill:#e6f4fc,stroke:#008FDB,color:#0f172a class Observe,Decide,Act,Learn step ``` ## Our divisions and products [#our-divisions-and-products] Each division turns our core research in Reinforcement Learning and Multi-Agent Systems into products that solve specific, high-impact problems. ### From research to deployed systems [#from-research-to-deployed-systems] ```mermaid flowchart LR Research["Research
RL & MARL"] Prototype["Prototype
Simulation"] Product["Product
Deployment"] Scale["Scale
Africa & Beyond"] Research --> Prototype Prototype --> Product Product --> Scale classDef stage fill:#dcfce7,stroke:#166534,color:#14532d class Research,Prototype,Product,Scale stage ``` We don't just publish papers: we turn research into products, platforms, and divisions that solve real challenges. From voice AI infrastructure to industrial robotics coordination, our work spans the full path from fundamental science to deployed systems, with a focus on Africa's unique opportunities. ## Active products [#active-products] ### Voxtra [#voxtra] Open-source voice AI platform for building multilingual voice agents, speech-to-text pipelines, and conversational systems, designed for African languages and beyond. - Voice Agent SDK - Multilingual STT / TTS - Real-time pipelines - Edge deployment [Read the Voxtra docs →](/voxtra) · [GitHub](https://github.com/rexplore-ai/voxtra) · [PyPI](https://pypi.org/project/voxtra/) ### Luso8 Cloud [#luso8-cloud] Intelligent GTM platform for African markets. Customer discovery, automated engagement, and AfCFTA expansion across 54 countries / 1.3B people. - Customer discovery - Automated engagement - AfCFTA expansion - AI-powered GTM [Read the Luso8 Cloud docs →](/luso8) · [Open Luso8 Cloud](https://luso8.rexplore.ai) ### Industrial Automation Division [#industrial-automation-division] The intelligence layer for industrial autonomy. We are building Multi-Agent RL systems that coordinate robot fleets, optimize production lines, and enable safe human-robot collaboration. - Fleet orchestration - Adaptive scheduling - Digital twin simulation - Safe autonomy (ISO/TS 15066, ISO 10218-2:2025) ## Our services [#our-services] | Service | What we do | | ----------------- | ------------------------------------------------------------------------ | | **AI Research** | Foundation models, multimodal AI, reinforcement learning, AI safety. | | **AI Solutions** | Custom AI models, integration, performance optimization, scalable arch. | | **AI Consulting** | AI strategy, technical consulting, team training, implementation roadmaps. | ## Company [#company] | Field | Value | | ------------- | ------------------------------------------------------------------ | | Industry | Technology, Information & Internet | | Headquarters | Lilongwe, Central Region, Malawi | | Founded | 2025 | | Size | 2 – 10 employees | | Website | [https://rexplore.ai](https://rexplore.ai) | | Phone | +265 996 668 149 | | Email | [hello@rexplore.ai](mailto:hello@rexplore.ai) | ### Specialties [#specialties] AI · Machine Learning · LLMs · Generative AI · Agentic AI · **Reinforcement Learning** · Deep Learning · Deep Reinforcement Learning · Research · **Multi-Agent Reinforcement Learning** ## Get in touch [#get-in-touch] Ready to explore how AI can transform your business? Let's start a conversation. - **Email**: [hello@rexplore.ai](mailto:hello@rexplore.ai) - **Phone**: +265 996 668 149 - **Location**: Lilongwe, Malawi