Basely

Basely API

API reference

One key per business. Read the books, bank accounts, transactions, invoices and bills of a business, write to them with the owner's permission, and get signed webhooks when something changes.

https://api.baselyapp.com/v1openapi.jsonAll developer tools

Quick start

  1. The owner of the business opens API in the Basely panel and creates a key with the scopes your system needs.
  2. Put the key in your server's environment. It is shown once.
  3. Call /v1/me to check the connection, then the endpoints you need.
curl https://api.baselyapp.com/v1/me \
  -H "Authorization: Bearer bsk_live_..."

curl "https://api.baselyapp.com/v1/financial/summary?period=2026-09" \
  -H "Authorization: Bearer bsk_live_..."

Authentication

Send the key as Authorization: Bearer bsk_live_... on every request.

  • The business comes from the key. There is no business id in the request, and a key never reaches another business.
  • Test keys (bsk_test_) read the real business and validate writes, but never save them.
  • Only the owner of the business creates, rotates and revokes keys. A key stops working when the person who created it is no longer the owner.
  • Rotating keeps the old key working for a grace period you choose, so your server can switch without downtime.
  • The owner gets an email every time a new key is created or rotated.

Scopes

Each key carries only the scopes it was given. An endpoint without its scope answers 403 SCOPE_DENIED.

ScopeServiceAccess
financial:readfinancialReads
accounts:readfinancialReads
transactions:readfinancialReads
transactions:writefinancialWrites to the books
invoices:readfinancialReads
invoices:writefinancialWrites to the books
bills:readfinancialReads
bills:writefinancialWrites to the books
contacts:readcrmReads
contacts:writecrmWrites
crm:readcrmReads
crm:writecrmWrites
conversations:readphoneReads
texts:sendphoneWrites
inbox:writephoneWrites
calls:createphoneWrites
sessions:managephoneWrites
otp:sendphoneWrites
phone_contacts:writephoneWrites
bank:refreshbankingComing later
email:sendemailWrites
email:reademailReads
email_templates:writeemailWrites
mailboxes:reademailReads
mailboxes:writeemailWrites
sms:sendsmsWrites
sms:readsmsReads
receptionist:readreceptionistReads
receptionist:writereceptionistWrites
receptionist:sessionsreceptionistWrites
social:readsocialReads
social:writesocialWrites
funnels:readfunnelsReads
automations:readautomationsReads
courses:readcoursesReads
calendar:readcalendarComing later
calendar:writecalendarComing later
files:readfilesComing later

Endpoints

Base URL below. Every response has an x-request-id header.

Platform

GET/v1/meany keyThe business and the key behind this request.

Financial

GET/v1/financial/summaryfinancial:readCash, inflows, outflows, expenses, recurring costs, burn and runway for a period.
GET/v1/financial/cash-flowfinancial:readCash flow month by month: operating, investing and financing.
GET/v1/financial/reports/{report}financial:readA financial report: pnl, balance-sheet, expenses-by-category or trial-balance.
GET/v1/accountsaccounts:readBank accounts connected to the books, with their ledger balance.
GET/v1/transactionstransactions:readBank transactions, newest first.
GET/v1/transactions/{id}transactions:readOne bank transaction.
POST/v1/transactions/{id}/categorizetransactions:writePost a bank transaction to a category in the books.
GET/v1/invoicesinvoices:readInvoices, newest first.
POST/v1/invoicesinvoices:writeCreate an invoice.
GET/v1/invoices/{id}invoices:readOne invoice, with what is still open.
POST/v1/invoices/{id}/paymentsinvoices:writeRecord a payment received for an invoice.
GET/v1/billsbills:readBills to pay, newest first.
POST/v1/billsbills:writeCreate a bill to pay.

CRM

GET/v1/contactscontacts:readContacts of the business.
POST/v1/contactscontacts:writeCreate a contact, or update the one with the same email or phone.
GET/v1/companiescrm:readCompanies of the business, newest first. Phone masked. Page with created_before.
GET/v1/dealscrm:readDeals of the business, newest first: stage, value in cents, contact and company. Filter with stage and archived=true. Page with created_before.
GET/v1/pipelinescrm:readThe business's pipelines, each with its stages in order.
GET/v1/taskscrm:readTasks of the business, newest first. status=open (default), done or all.
POST/v1/dealscrm:writeCreate a deal: name, and optionally stage, pipeline_id, category, value_cents, currency, contact_id, company_id, expected_close. Requires Idempotency-Key.
PATCH/v1/deals/{id}crm:writeUpdate a deal or move it to another stage: name, stage, category, value_cents, contact_id, company_id, expected_close, archived. Moving a stage can start an automation the owner turned on. Requires Idempotency-Key.
POST/v1/companiescrm:writeCreate a company: name, and optionally industry, phone, email, address, website, description. Requires Idempotency-Key.
POST/v1/taskscrm:writeCreate a task: text, and optionally type (follow_up, ligar, visita, enviar, outro), due_at, contact_id, deal_id. Requires Idempotency-Key.
PATCH/v1/tasks/{id}crm:writeMark a task done or open again: { done }. Requires Idempotency-Key.

Email

POST/v1/email/sendemail:sendSend one transactional email from the business's verified domain. Accepts Idempotency-Key.
POST/v1/email/send/batchemail:sendSend up to 100 transactional emails in one call, each with ONE recipient, its own variables and its own idempotency_key. Each message counts 1 in the plan's emails. The answer is per message (207 when some failed). More than 20 identical messages without variables is a campaign (422), and batches are limited to 300 messages per hour per business (429). Attachments go one per call on /v1/email/send.
GET/v1/email/messagesemail:readEmails sent by the business, newest first.
GET/v1/email/messages/{id}email:readOne email, with its status and delivery events.
GET/v1/email/sendersemail:readThe business's sender and whether it can send now.
GET/v1/email/templatesemail:readThe business's email templates.
POST/v1/email/templatesemail_templates:writeCreate a template. A slug that already exists (from the panel, the connector or the API) returns 409 SLUG_EXISTE with its origin; change it with PUT. Variables are {{name}} and are escaped on send.
GET/v1/email/templates/{slug}email:readOne template.
PUT/v1/email/templates/{slug}email_templates:writeUpdate a template, wherever it was created (panel, connector or API).
POST/v1/email/templates/batchemail_templates:writeCreate or update up to 50 templates in one call (counts as one request). Each item may set mode: upsert (default), create or update. The answer is per item (207 when some failed); the same batch repeated gives the same result.
DELETE/v1/email/templates/{slug}email_templates:writeMove a template to the trash for 30 days (restore with POST .../restore). A template used in the last 7 days returns 409 TEMPLATE_IN_USE with last_used_at; repeat with ?confirm=true.
POST/v1/email/templates/{slug}/restoreemail_templates:writeBring a template back from the trash within 30 days. 409 SLUG_EXISTE if the slug was created again meanwhile.
POST/v1/email/templates/{slug}/previewemail_templates:writeRender a saved template with example variables, as it would be sent. Does not send, does not count and fetches nothing. Lists missing_variables.
POST/v1/email/templates/previewemail_templates:writeRender a template that is not saved yet (template: subject, html, text) with example variables. Does not send, save or fetch anything.
GET/v1/mailboxesmailboxes:readThe business's mailboxes: those on a domain of the business's site, owned by the business owner.
GET/v1/mailboxes/{address}mailboxes:readOne mailbox, with usage (bytes_used, bytes_max, messages) and two_factor_enabled read live from the mail server (null when it could not be read). A mailbox of another business returns 404.
POST/v1/mailboxesmailboxes:writeCreate a mailbox on a domain of the business's site, within the plan's free mailboxes (above it, 402 with the link to pay in the panel). No password is accepted or returned: a single-use link to set it (24 hours) goes to the account's email.
POST/v1/mailboxes/{address}/password-linkmailboxes:writeSend the account owner a single-use link (24 hours) to set the mailbox password. The password never goes through the API.
GET/v1/mailboxes/{address}/forwardingmailboxes:readForwarding destinations of the mailbox and whether each one is confirmed.
PUT/v1/mailboxes/{address}/forwardingmailboxes:writeAsk to forward the mailbox to an address. Nothing is forwarded until the owner of the destination confirms by the link we send there; the API cannot confirm. The account owner is notified.
DELETE/v1/mailboxes/{address}/forwardingmailboxes:writeStop forwarding to ?destination=.
PUT/v1/mailboxes/{address}/autorespondermailboxes:writeTurn the automatic reply on or off, with an optional start and end. One reply per sender every 24 hours.
PUT/v1/mailboxes/{address}/aliasesmailboxes:writeReplace the mailbox aliases (addresses on the same domain that deliver to it). The account owner is notified.

SMS

POST/v1/sms/sendsms:sendSend one transactional text from a business number. Accepts Idempotency-Key.
GET/v1/sms/messagessms:readTexts sent by the business, newest first. Recipients are masked.
GET/v1/sms/messages/{id}sms:readOne text, with its delivery status and segments.
GET/v1/sms/senderssms:readThe business numbers, with the US A2P registration status and whether each can send now.

AI Receptionist

GET/v1/receptionist/agentsreceptionist:readThe business's AI receptionist agents (one in v1), with greeting, hours, languages and powers.
GET/v1/receptionist/agents/{id}receptionist:readOne agent.
PATCH/v1/receptionist/agents/{id}receptionist:writeChange the agent: name, greeting, voice, timezone, languages, hours, powers, instructions and knowledge.
PUT/v1/receptionist/agents/{id}/toolsreceptionist:writeReplace the set of Basely tools the agent may use.
GET/v1/receptionist/toolsreceptionist:readThe Basely tools (enabled or not) and the app tools registered for the agent.
GET/v1/receptionist/app-toolsreceptionist:readTools of your own system that the receptionist can call.
POST/v1/receptionist/app-toolsreceptionist:writeRegister (or update by name) a tool of your system. The signing secret is returned once, on creation.
DELETE/v1/receptionist/app-tools/{name}receptionist:writeRemove a registered app tool.
GET/v1/receptionist/numbersreceptionist:readThe numbers the receptionist answers, with channels and the US SMS registration.
GET/v1/receptionist/sessionsreceptionist:readCalls and text conversations the receptionist handled, newest first.
POST/v1/receptionist/sessionsreceptionist:sessionsTalk to the receptionist from your site or app chat (channel web): send the visitor's message, get the reply.
POST/v1/receptionist/sessions/{id}/handoffreceptionist:sessionsHand a conversation to the team: the receptionist stops answering this contact for 24 hours and the owner is notified.
GET/v1/receptionist/sessions/{id}receptionist:readOne session, with transcript, summary, outcome and measured cost.
GET/v1/receptionist/usagereceptionist:readUsage this month: the receptionist's own cost by part, and the texts and emails it started.

Social

GET/v1/social/accountssocial:readThe social accounts connected to the business (Instagram, Facebook...).
GET/v1/social/automationssocial:readThe automations the owner set up in Social > Plugs, with the photo slots and variables of each template.
POST/v1/social/mediasocial:writeStore a photo in the business library, from an https URL or the raw image body. Returns a media id.
POST/v1/social/postssocial:writePost through an automation: send the photos and variables; the template and caption the owner accepted go out on their own. Accepts Idempotency-Key.
GET/v1/social/postssocial:readPosts requested through the API, newest first, rejections included.
GET/v1/social/posts/{id}social:readOne post, with its status and the links once it is published.

Funnels

GET/v1/funnelsfunnels:readThe business's funnels: status, number of steps and when they were published.
GET/v1/funnels/submissionsfunnels:readForm submissions from the funnels, newest first: the answers, consent, and the contact and deal they created. Filter with funnel_id or form_id. Personal data: the visitor's IP is never returned.

Automations

GET/v1/automationsautomations:readThe business's automations: enabled, published, trigger type, number of steps and how many contacts are in them.
GET/v1/automations/{id}/runsautomations:readRuns of one automation, newest first, each with its steps and results. status=active, done, failed, waiting_approval or left.

Courses

GET/v1/coursescourses:readThe business's courses with their status and number of students.
GET/v1/courses/{id}/studentscourses:readStudents of one course with their progress and certificate.

Phone and texts

GET/v1/businesses/{negocioId}/conversationsconversations:readMessages and calls, masked.
POST/v1/businesses/{negocioId}/textstexts:sendSend a text from the business number.
POST/v1/businesses/{negocioId}/emailsinbox:writeHand a received email to the inbox.
POST/v1/businesses/{negocioId}/callscalls:createRing a team member.
POST/v1/businesses/{negocioId}/contactsphone_contacts:writeDeclare a customer or a team member.
POST/v1/businesses/{negocioId}/sessionssessions:manageOpen a masked line.
DELETE/v1/businesses/{negocioId}/sessions/{sessionId}sessions:manageClose a masked line.
POST/v1/businesses/{negocioId}/otpotp:sendSend a one-time code by text.
POST/v1/businesses/{negocioId}/otp/verifyotp:sendVerify a one-time code.

Conventions

  • Money is in integer cents with a currency. Dates are ISO 8601.
  • Lists return object: list, data, has_more. Use limit (up to 100) and from/to to narrow them.
  • Balances come from the books, which the bank keeps in sync by itself. Reading never asks the bank directly.
  • A manual refresh from the bank (Fresh) is a separate action with its own monthly quota. Reading the API never spends one.
  • Rate limits per key per minute: 120 reads, 30 writes, 20 reports. Over the limit: 429 with retry-after.
  • Besides the per key limit, the whole business has a ceiling across its keys: 300 reads and 60 writes per minute (BUSINESS_RATE_LIMITED).
  • Every write accepts the Idempotency-Key header. Repeating it with the same request returns the saved answer, with Idempotent-Replayed: true, for 24 hours; with a different request, 409 IDEMPOTENCY_KEY_REUSED.
  • The API reads and writes inside the business. What it sends on the business's behalf (email, text, code, a post through an automation) only goes with the scope the owner granted. Charging, refunds, prices and purchases never go through the API.

Errors

Errors have a stable code, a message for people and the request id. Write errors add reason and field.

{ "error": { "code": "SCOPE_DENIED", "message": "...", "scope": "invoices:write", "request_id": "req_..." } }
LEVEL_NOT_ALLOWEDThis action is not available through the API. Do it in the dashboard.
BUSINESS_RATE_LIMITEDToo many requests for this business across all its keys. Retry after the time in Retry-After.
IDEMPOTENCY_KEY_INVALIDIdempotency-Key must be 1 to 255 printable ASCII characters.
IDEMPOTENCY_KEY_REQUIREDThis write needs an Idempotency-Key header. Send a new one per action and repeat it on retries.
MISSING_KEYSend your API key as Authorization: Bearer <key>.
INVALID_KEYThis API key is not valid.
KEY_REVOKEDThis API key was revoked or replaced. Use the current key of this business.
KEY_EXPIREDThis API key expired. Ask the owner of the business for a new one.
NOT_FOUNDNot found.
BUSINESS_FROZENThis business is frozen. Calls resume when it is active again.
BUSINESS_CLOSEDThis business is closed.
SCOPE_DENIEDThis key does not have the scope this endpoint needs.
AFFILIATE_ONLY_ACCOUNTThis key belongs to an affiliate-only account, which cannot use the API.
MODULE_NOT_ENABLEDFinance is not enabled for this business.
BOOKS_NOT_SET_UPThe books of this business are not set up yet.
RATE_LIMITEDToo many requests for this key. Wait and try again.
INVALID_REQUESTThe request is not valid.
INVALID_JSONThe body must be a JSON object.
TEST_MODETest keys validate writes but never save them.
CONFLICTThe books do not allow this change right now. See reason.
FORBIDDENThe owner of this key can no longer do this in the business.
NO_SENDERThis business has no sender for this channel yet.
SENDER_NOT_REGISTEREDThis number is not registered with the carriers for business texting yet (A2P 10DLC). Finish the registration in Phone > Number.
SENDER_NOT_VERIFIEDThe sender domain of this business is not verified yet.
SENDER_PAUSEDSending is paused for this business. See the reason in the panel.
SYSTEM_SENDER_ONLY_FOR_SYSTEMThe system sender only sends system messages.
RECIPIENT_OPTED_OUTThis recipient opted out of texts from this business.
RECIPIENT_SUPPRESSEDThis address bounced or complained before; sending is blocked.
RECIPIENT_REJECTEDThe provider rejected this recipient.
RECIPIENT_NOT_FOUNDNo contact with this id or external id in this business.
TETO_GLOBAL_DE_SMSTexting is paused for the whole platform right now (daily limit). Try again later.
DESTINO_FORA_DA_ZONAThis number is outside the dialing zone of the business number. Texts and calls stay within the same country (US and Canada for +1).
INVALID_RECIPIENTThe recipient is not a valid phone number in E.164 format.
EMPTY_BODYThe message body is empty.
QUOTA_EXCEEDEDThe quota of this business for this service is used up.
PROVIDER_UNAVAILABLEThe delivery provider is unavailable. Try again later with the same Idempotency-Key.
IDEMPOTENCY_KEY_REUSEDThis Idempotency-Key was already used with a different request.
IDEMPOTENCY_IN_PROGRESSA request with this Idempotency-Key is still being processed.
BULK_NOT_ALLOWEDOne recipient per request. Lists are campaigns.
CATEGORY_NOT_ALLOWEDThis category is not allowed for this service yet.
CHANNEL_NOT_AVAILABLEThis channel is not offered. See the hint.
RECEPTIONIST_OFFThe receptionist is turned off for this business.
PLAN_REQUIREDThe business needs an active Phone plan for the receptionist to answer.
BUDGET_REACHEDThe receptionist reached this month's spending cap. A person will follow up.
TEMPLATE_NOT_FOUNDNo template with this slug in this business.
TEMPLATE_IN_USEThis template was used in the last 7 days. Repeat with ?confirm=true to move it to the trash anyway (restorable for 30 days).
ATTACHMENT_URL_NOT_ALLOWEDAttachments are not fetched from URLs. Send the content in base64 or a storage_id from POST /v1/social/media.
ATTACHMENT_NOT_FOUNDNo file with this storage_id in this business.
ATTACHMENT_TYPE_NOT_ALLOWEDOnly PNG, JPEG, GIF, WebP, PDF and .ics files can be attached. The type is read from the content.
ATTACHMENT_PDF_ACTIVE_CONTENTThis PDF has JavaScript, a launch action or an embedded file, and cannot be attached.
ATTACHMENT_NAME_INVALIDThe file name must be up to 120 characters, without line breaks.
ATTACHMENT_NAME_MISMATCHThe file name extension does not match its content.
ATTACHMENT_TOO_LARGEEach attachment can have at most 5 MB.
ATTACHMENTS_TOO_LARGEThe attachments of one email can have at most 10 MB together.
TOO_MANY_ATTACHMENTSAt most 5 attachments per email.
TOO_MANY_ITEMSAt most 50 templates per batch.
PAYLOAD_TOO_LARGEThe request body is too large (5 MB at most).
DUPLICATE_IN_BATCHThe same slug appears twice in this batch.
SLUG_EXISTEA template with this slug already exists in this business (see origin: panel, connector or API). Use PUT /v1/email/templates/{slug} to change it.
SEND_FAILEDThe message was not accepted for delivery. Do not retry it unchanged.
AUTOMATION_NOT_FOUNDNo automation with this name in this business. See GET /v1/social/automations.
AUTOMATION_OFFThis automation is off. The owner turns it on in Social > Plugs; a change to its template or caption turns it off until accepted again.
SOCIAL_PLAN_REQUIREDThe business needs an active Social plan to publish.
CONSENT_REQUIREDSend consent.photo: true and consent.collected_at: the customer must have authorized the photo before it is posted.
DAILY_LIMIT_REACHEDThis automation reached its daily limit. The owner sets it in Social > Plugs.
MISSING_PHOTOA photo slot of the template has no photo. See field.
UNKNOWN_SLOTThis photo slot does not exist in the template. See field.
INVALID_PHOTOThe photo must be an https URL or a media id from POST /v1/social/media.
PHOTO_UNAVAILABLEWe could not download this photo as a PNG, JPG or WEBP image. See field.
PHOTO_TOO_LARGEPhotos go up to 15 MB.
MEDIA_NOT_FOUNDNo image with this media id in this business.
MISSING_VARIABLEA text variable of the template is missing. See field.
UNKNOWN_VARIABLEThis variable does not exist in the template. See field.
INVALID_VARIABLEVariables are up to 30 characters, one line, with no link, @ or #.
RENDER_UNAVAILABLEThe artwork could not be rendered right now. Try again later with the same reference.
PUBLISH_FAILEDThe post was not accepted by the publishing engine. See the post status.
PASSWORD_NOT_ACCEPTEDThe API never receives a mailbox password. A single-use link to set it goes to the account's email.
DOMAIN_NOT_IN_BUSINESSThis domain is not a domain of the business's site.
MAILBOX_REQUIRES_PAYMENTThis mailbox is beyond the plan's free mailboxes. Add it in the panel (see cta).
PLAN_LOCKEDCreating mailboxes unlocks after the account's first payment (see cta).
MAILBOX_EXISTSA mailbox with this address already exists.
MAILBOX_IS_GROUPThis address is a group: it forwards to its members and has no password or login.
CONTA_SEM_EMAILThe account that owns this mailbox has no email to receive the link.
SERVICE_UNAVAILABLEThe mail service is not configured right now. Try again later.
PROVIDER_FAILEDThe mail server did not accept the change. Try again; if it keeps failing, send us the request_id.
TOO_MANY_MESSAGESAt most 100 messages per batch.
ATTACHMENTS_NOT_IN_BATCHEmails with attachments are sent one per call on POST /v1/email/send.
DUPLICATE_IDEMPOTENCY_KEYThe same idempotency_key appears twice in this batch.
BATCH_LOOKS_LIKE_CAMPAIGNMore than 20 messages in this batch have the same content and no variables. That is a campaign: send it from Email marketing, with unsubscribe.
BATCH_HOURLY_LIMITThis business reached the batch limit for the last hour (see limit and used). Try again later or send one per call.
INTERNALSomething failed on our side. Try again; if it keeps failing, send us the request_id.

Webhooks

The owner adds the address of your system and picks the events. Deliveries retry for 24 hours.

transaction.createdtransaction.categorizedinvoice.createdinvoice.paidbill.createdbill.paidbank_connection.disconnectedsms.sentsms.deliveredsms.failedsms.opted_outemail.sentemail.deliveredemail.bouncedemail.complainedemail.failedemail.sender.verifiedemail.sender.failedreceptionist.session.startedreceptionist.session.endedreceptionist.handoff_requestedreceptionist.tool_calledsocial.post.publishedsocial.post.failed

Each delivery is signed with your endpoint secret in basely-signature, and carries basely-event-id so you can drop duplicates. Verify it like this:

import { createHmac, timingSafeEqual } from "node:crypto";

// header: basely-signature: t=<unix seconds>,v1=<hex>
export function isFromBasely(rawBody: string, header: string, secret: string): boolean {
  const parts = Object.fromEntries(header.split(",").map((p) => p.split("=") as [string, string]));
  const expected = createHmac("sha256", secret).update(`${parts.t}.${rawBody}`).digest("hex");
  const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
  return fresh && timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1 ?? ""));
}