Organization tools
All tool areas. Each tool acts within your access.
Organization
close_organization
Close the organization for good (the end of Lokl's Terms): online booking, staff changes, agents, in-app AI, and every email stop at once; members can still sign in to read and export its data (reports, lists, export_customer_data) for 90 days, and then it is deleted. Refused (conflict, saying what to do) while anything is still owed or due: an order waiting for payment, a booking still to come, a balance due, money owed back, a refund on its way or failed, a payment still processing, a gift certificate not yet delivered, an open quote, an email to a guest still being sent, or a Lokl plan that still renews (cancel it in the billing portal first). Guests' gift certificate and credit balances don't stop it: they stay the operator's to honour, and the preview says how much is outstanding. Owner only (organization:close). Can be undone for 15 minutes; after that, contact Lokl to reopen it before its data is deleted. Returns a preview to confirm.
Changes · Members of an organization · Needs organization:close
Input
reasonWhy it's closing, kept in the activity log
Output
organizationThe organization (org_…)
closedAtpurgeAfterWhen its data is deleted: until then members can read and export it
create_organization
Create a new organization with you as its owner, and the standard and exempt tax classes. Returns a preview to confirm; nothing is created until the changeset is applied. The slug is derived from the name unless you give one. Set undoable to false to give up the 15-minute undo, so the trial's AI credits arrive at once (the dashboard's sign-up does). The trial's AI credits come with a person's first organization only: every later one gets the 30-day trial without them. A person can create 3 organizations in any 24 hours (conflict after that).
Changes · Any signed-in person
Input
nameslugundoablesourceWhere the sign-up came from, for Lokl's own analytics (the dashboard's sign-up sends its link's campaign parameters): { utmSource, utmMedium, utmCampaign, utmContent, utmTerm, referringDomain (a host name only), landingPath (starts with /) }, each up to 200 characters. Anything else is dropped; it is never shown back
source.utmSourceutm_source: who sent the visitor
source.utmMediumutm_medium
source.utmCampaignutm_campaign
source.utmContentutm_content
source.utmTermutm_term
source.referringDomainThe referring site's host name only
source.landingPathThe first page's path, starting with /
Output
idnameslug
export_organization
Export all of the organization's data as CSV files in one ZIP: customers, orders with their lines, bookings, payments, refunds, products, sessions, gift certificates, credits, invoices, quotes, staff notes, marketing consent and tips, money in each row's currency and times at each location's time zone. It's built in the background; you get an email with a download link that works for 7 days, and get_organization_export says when it's ready and gives the link. Asking while one is being built returns that one. Works while the organization is closed (its data can be exported until it's deleted). Owner only (organization:export). Returns a preview to confirm.
Changes · Members of an organization · Needs organization:export
No input.
Output
statusrunningrunning.idThe export (oex_…)
running.requestedAtalreadyRunningTrue when an export was already being built and this is that one
get_organization
Get the organization you're signed in to: its id, name, and slug. Use it to confirm which organization your other calls act in.
Reads · Members of an organization · Needs organization:read
No input.
Output
idnameslugclosedAtWhen it was closed (close_organization): nothing can be changed, and its data can be read and exported until purgeAfter. Null while open. Always present
purgeAfterWhen a closed organization's data is deleted (90 days after closedAt). Null while open. Always present
update_organization
Rename the organization. Its slug and booking links don't change. Use get_organization to read its current name. Returns a preview to confirm; can be undone for 15 minutes unless the name changes again.
Changes · Members of an organization · Needs settings:write
Input
name
Output
organizationorganization.idorganization.nameorganization.slug