{"openapi":"3.1.0","info":{"title":"Alori data API","version":"1","description":"Read and search your records with a read key (`GET /v1/objects/{type}`, `GET /v1/objects/{type}/{id}`), or import with an import key (`POST /v1/objects/{type}/batch`). A full access key does both, deletes records, texts and emails customers (`/v1/messages`), posts in Team chat (`/v1/chat/messages`), tags them, moves deals, books (`/v1/bookings`), blocks calendar time (`/v1/events`), lists the team and manages webhooks (`/v1/webhooks`). Each key belongs to one app. Send the same `externalId` again to update a record instead of duplicating it. `GET /v1/objects` lists your app's types and fields; the guide with them is in Alori, under Connectors → API. Errors answer `{ \"error\": { \"code\", \"message\" } }`; each key may make 120 requests a minute, and the `RateLimit-*` headers say how many are left."},"servers":[{"url":"https://api.alori.dev"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"An API key from Connectors → API in Alori: a read key for reports, an import key to import, a full access key for your own software."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}},"Webhook":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"enum":["customer.created","customer.updated","customer.deleted","deal.created","deal.updated","deal.deleted","company.created","company.updated","company.deleted","contact.created","contact.updated","contact.deleted","task.created","task.updated","task.deleted","booking.created","booking.updated","booking.cancelled","booking.deleted","note.created","message.received","ticket.created","ticket.updated","ticket.deleted","ticket.commented","record.created","record.updated","record.deleted"]}},"createdAt":{"type":"integer"},"on":{"type":"boolean","description":"False once paused, by you or after 20 failed deliveries in a row."},"lastDeliveredAt":{"type":"integer"},"lastError":{"type":"string"}}},"Record":{"type":"object","required":["id","createdAt","externalIds"],"additionalProperties":true,"properties":{"id":{"type":"string"},"createdAt":{"type":"integer","description":"When it was really made, in milliseconds since 1970."},"updatedAt":{"type":"integer","description":"Customers, deals, companies, contacts and tasks: when it last changed, in milliseconds since 1970; its `createdAt` when it never changed. Filter with `updatedAt[gte]=` to read what changed since."},"externalIds":{"type":"array","items":{"type":"string"},"description":"The ids an import gave this record (`hubspot:deals:456`, `hubspot:leads:789` for a HubSpot lead that became this deal, or your own `externalId`); empty when none."},"stageDates":{"type":"object","additionalProperties":{"type":"integer"},"description":"Deals: when the deal last entered each stage, by stage key, in milliseconds since 1970. Kept by Alori on every move; an import may send it."},"ownerId":{"type":"string","description":"A deal's, customer's or company's owner: a `userId` from `GET /v1/team`."}},"description":"Every stored field of the record; `GET /v1/objects` lists them per type. Custom fields are `custom_<key>`."},"Reference":{"description":"Another record: one you imported (`externalId`), one already in the app (`id`), or a customer by `email`.","oneOf":[{"type":"object","properties":{"externalId":{"type":"string"}},"required":["externalId"]},{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},{"type":"object","properties":{"email":{"type":"string"}},"required":["email"]}]},"Run":{"type":"object","properties":{"id":{"type":"string"},"env":{"enum":["live","test"]},"source":{"enum":["api","csv","connector","migration"]},"status":{"enum":["open","undoing","undone"]},"created":{"type":"integer"},"updated":{"type":"integer"},"unchanged":{"type":"integer"},"failed":{"type":"integer"},"kept":{"type":"integer"},"createdAt":{"type":"integer","description":"Milliseconds since 1970."},"updatedAt":{"type":"integer"}}}}},"paths":{"/v1/objects":{"get":{"operationId":"listObjectTypes","summary":"List the object types and their fields","description":"Read from the app's live schema, so fields added to the app show up here.","responses":{"200":{"description":"Object types","content":{"application/json":{"schema":{"type":"object","properties":{"objects":{"type":"array","items":{"type":"object","properties":{"type":{"enum":["customFields","companies","customers","contacts","pipelines","deals","priceItems","quotes","jobs","invoices","notes","communications","tasks","projects","ticketTeams","ticketStatuses","ticketCycles","tickets","ticketLinks","ticketEvents","projectTime","timeRates","outreachSequences","outreachLeads","payments","campaigns","campaignRecipients","dealStageChanges","ticketLabels","projectMilestones","projectUpdates","initiatives","deletedRecords"]},"readOnly":{"type":"boolean","description":"Read and filtered, never imported or deleted."},"custom":{"type":"boolean","description":"A table the owner added to their app: read, created, updated and deleted like the others, every field its own."},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"required":{"type":"boolean"},"values":{"type":"array","items":{}},"references":{"type":"string"}}}}}}}}}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The app is not ready for imports","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/objects/{type}":{"get":{"operationId":"listRecords","summary":"Read or search records, a page at a time","description":"Needs a read or full access key. Pass `nextCursor` back as `cursor` until it is null. Each record has `id`, `createdAt` (milliseconds since 1970), `externalIds` (the ids imports gave it, such as `hubspot:deals:456`) and every stored field; references are ids (an `ownerId` is a `userId` from `GET /v1/team`); custom fields are `custom_<key>` columns. Customers, deals, companies, contacts and tasks also have `updatedAt`: `updatedAt[gte]=<ms or ISO date>` reads what changed since a sync, and `deletedRecords` what was deleted. Deals have `stageDates`, when they last entered each stage; `dealStageChanges` is every move (`dealId`, `at`, `fromStageKey`, `toStageKey`, `pipelineId`, `byId`, a `userId`), which an import may also bring (`dealId` by your deal's `externalId`).\n\n**Read-only types.** ticketLabels, projectMilestones, projectUpdates, initiatives, deletedRecords are read here and by id, never imported or deleted: the labels a ticket's `labelIds` name, the milestones its `milestoneId` names, each project's updates (`projectId`, `health`, `body`, `at`), and the initiatives a project's `initiativeId` names (`name`, `status`, `ownerId`, `targetDay`), and `deletedRecords`: the customers, deals, companies, contacts and tasks deleted in the last 90 days (`table`, `recordId`, `deletedAt`, and `mergedInto` for a customer merged into another), so a sync removes them too: `deletedRecords?deletedAt[gte]=<ms>`. An app not updated since answers `409 appNeedsUpdate` for them.\n\n**Filters.** Any other query parameter filters on the field of that name: `field=value` (equals), or `field[op]=value` with `op` one of `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `contains`, `exists`. Words ignore case and the spaces around them; numbers and dates compare as numbers, and a date may be ISO text (`createdAt[gte]=2026-01-01`); a list field matches when any item does. Records must pass every filter, at most 10 of them. A field the type doesn't have answers `400 unknownField` with the fields you can use. `?email=ana@example.com` finds a customer by any of their addresses.\n\n**Pages.** A page never holds more than `limit` records. A filter on a field without an index reads the records in order and stops at a read budget, so a page can hold fewer records than `limit`, even none, with a `nextCursor` to keep looking: the search is over only when `nextCursor` is null.","parameters":[{"name":"type","in":"path","required":true,"schema":{"enum":["customFields","companies","customers","contacts","pipelines","deals","priceItems","quotes","jobs","invoices","notes","communications","tasks","projects","ticketTeams","ticketStatuses","ticketCycles","tickets","ticketLinks","ticketEvents","projectTime","timeRates","outreachSequences","outreachLeads","payments","campaigns","campaignRecipients","dealStageChanges","ticketLabels","projectMilestones","projectUpdates","initiatives","deletedRecords"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"`nextCursor` of the page before. Use it with the same `order`."},{"name":"order","in":"query","required":false,"schema":{"enum":["asc","desc"],"default":"asc"},"description":"`asc`: oldest first. `desc`: newest first."},{"name":"filters","in":"query","required":false,"style":"form","explode":true,"description":"Field filters, e.g. `email=ana@example.com`, `status[ne]=paid`, `total[gte]=100`, `name[contains]=tremblay`, `phone[exists]=false`, `custom_region=Laval`.","schema":{"type":"object","additionalProperties":{"type":"string"}}}],"responses":{"200":{"description":"One page of records","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Record"}},"nextCursor":{"type":["string","null"],"description":"Null on the last page."}}}}}},"400":{"description":"`invalidQuery` (a bad limit, order or filter), `unknownField` or `invalidCursor`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"An import key; reading needs a read key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The app needs an update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createRecord","summary":"Create one record","description":"Needs an import or full access key. `externalId` is optional: send your own id to find the record again by it, and a second call with the same one updates the record instead of making another. Answers the record with its `id`.","parameters":[{"name":"type","in":"path","required":true,"schema":{"enum":["customFields","companies","customers","contacts","pipelines","deals","priceItems","quotes","jobs","invoices","notes","communications","tasks","projects","ticketTeams","ticketStatuses","ticketCycles","tickets","ticketLinks","ticketEvents","projectTime","timeRates","outreachSequences","outreachLeads","payments","campaigns","campaignRecipients","dealStageChanges"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"externalId":{"type":"string"},"fields":{"type":"object","additionalProperties":true}},"required":["fields"]}}}},"responses":{"201":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Record"},"action":{"enum":["created","updated","unchanged"]}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/objects/{type}/{id}":{"get":{"operationId":"getRecord","summary":"Read one record by its id","description":"Needs a read or full access key. The `id` a list or an import gave you.","parameters":[{"name":"type","in":"path","required":true,"schema":{"enum":["customFields","companies","customers","contacts","pipelines","deals","priceItems","quotes","jobs","invoices","notes","communications","tasks","projects","ticketTeams","ticketStatuses","ticketCycles","tickets","ticketLinks","ticketEvents","projectTime","timeRates","outreachSequences","outreachLeads","payments","campaigns","campaignRecipients","dealStageChanges","ticketLabels","projectMilestones","projectUpdates","initiatives","deletedRecords"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The record","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Record"}}}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"An import key; reading needs a read key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` or an unknown type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteRecord","summary":"Delete a record","description":"Needs an import or full access key. customers, companies, contacts, deals, notes, jobs, quotes, invoices, projects, pipelines, or a table the owner added (`custom` in `GET /v1/objects`). Only that record goes (a customer's deals and company stay). No undo.","parameters":[{"name":"type","in":"path","required":true,"schema":{"enum":["customers","companies","contacts","deals","notes","jobs","quotes","invoices","projects","pipelines"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateRecord","summary":"Update one record","description":"Needs an import or full access key. The fields sent change; the others stay. A field set to null is cleared.","parameters":[{"name":"type","in":"path","required":true,"schema":{"enum":["customFields","companies","customers","contacts","pipelines","deals","priceItems","quotes","jobs","invoices","notes","communications","tasks","projects","ticketTeams","ticketStatuses","ticketCycles","tickets","ticketLinks","ticketEvents","projectTime","timeRates","outreachSequences","outreachLeads","payments","campaigns","campaignRecipients","dealStageChanges"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fields":{"type":"object","additionalProperties":true}},"required":["fields"]}}}},"responses":{"200":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Record"},"action":{"enum":["updated","unchanged"]}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/objects/{type}/batch":{"post":{"operationId":"importRecords","summary":"Create or update records","description":"Up to 500 records. Import parents first (companies, customers, then the rest). Money and numbers may be text (\"1 650,00 $\"), dates ISO text (\"2026-03-04\"). A field set to null is cleared. Pass `X-Alori-Run` to add this batch to an earlier run, so one undo covers both.","parameters":[{"name":"type","in":"path","required":true,"schema":{"enum":["customFields","companies","customers","contacts","pipelines","deals","priceItems","quotes","jobs","invoices","notes","communications","tasks","projects","ticketTeams","ticketStatuses","ticketCycles","tickets","ticketLinks","ticketEvents","projectTime","timeRates","outreachSequences","outreachLeads","payments","campaigns","campaignRecipients","dealStageChanges"]}},{"name":"X-Alori-Run","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["records"],"properties":{"records":{"type":"array","maxItems":500,"items":{"type":"object","required":["fields"],"properties":{"externalId":{"type":"string","description":"Your id for this record, unique per object type. Send this or `id`."},"id":{"type":"string","description":"The Alori id of a record already in the app (as GET /v1/objects returns it), in place of `externalId`: only updates that record, never creates one; an unknown id fails the row with `recordNotFound`."},"fields":{"type":"object","additionalProperties":true}}}},"match":{"enum":["natural","externalId"],"default":"natural","description":"`natural`: a record not imported before is matched to one already in the app (customer by email or phone, company by domain or name, price item by name, quote and invoice by number). `externalId`: always create it."},"dryRun":{"type":"boolean","default":false,"description":"Check every record and write nothing."}}}}}},"responses":{"200":{"description":"One result per record, in order","content":{"application/json":{"schema":{"type":"object","properties":{"runId":{"type":"string"},"results":{"type":"array","items":{"type":"object","properties":{"externalId":{"type":"string"},"id":{"type":"string"},"action":{"enum":["created","updated","unchanged","failed"]},"errors":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"code":{"type":"string"}}}}}}}}}}}},"400":{"description":"Bad body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The app is not ready for imports","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Too many records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A record is malformed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/imports":{"get":{"operationId":"listImportRuns","summary":"List recent import runs","responses":{"200":{"description":"Runs, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"$ref":"#/components/schemas/Run"}}}}}}}}}},"/v1/imports/{runId}":{"get":{"operationId":"getImportRun","summary":"Get an import run","parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The run","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"}}}},"404":{"description":"No such run","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"undoImportRun","summary":"Undo an import run","description":"Deletes the records this run created. Records the team added to since (a job on an imported customer) are kept.","parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Undone","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"integer"},"kept":{"type":"integer"}}}}}},"404":{"description":"No such run","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Already undone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/messages":{"post":{"operationId":"sendMessage","summary":"Text or email a customer","description":"Needs a full access key. Goes out right away from the business's number or address, shows on the customer's history, and is skipped for customers who texted STOP. An email needs a subject; sendAt (ISO) sends it later. An email can bring its own design: html is the whole email (up to 300,000 characters), sent as is, and text is its plain-text version for mail apps that don't show HTML; it goes out right away, without sendAt. cc copies others in; bcc copies them hidden.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string"},"channel":{"enum":["sms","email"]},"text":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string"},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"sendAt":{"type":"string"}},"required":["customerId","channel","text"]}}}},"responses":{"201":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"sent":{"const":true},"channel":{"type":"string"},"to":{"type":"string"}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/customers/{id}/tags":{"post":{"operationId":"tagCustomer","summary":"Add or remove a customer's tags","description":"Needs a full access key. A tag that doesn't exist yet is made.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"add":{"type":"array","items":{"type":"string"}},"remove":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"added":{"type":"array","items":{"type":"string"}},"removed":{"type":"array","items":{"type":"string"}}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/deals/{id}/stage":{"post":{"operationId":"moveDeal","summary":"Move a deal to a stage","description":"Needs a full access key. stage is a stage key from GET /v1/objects/pipelines, won or lost included. A stage that requires fields answers 422 with the missing ones.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"stage":{"type":"string"},"pipelineId":{"type":"string"},"lostReason":{"type":"string"}},"required":["stage"]}}}},"responses":{"200":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chat/channels":{"get":{"operationId":"listChatChannels","summary":"List Team chat channels","description":"Needs a full access key. The key's person's channels and direct messages, most recent first, each with its channelId, kind (public, private, dm) and unread count. browse=true adds the public channels they haven't joined; people=true adds everyone they can write to.","parameters":[{"name":"browse","in":"query","schema":{"type":"boolean"}},{"name":"people","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"channels":{"type":"array","items":{"type":"object"}}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chat/channels/{channel}/messages":{"get":{"operationId":"readChatChannel","summary":"Read a Team chat channel's messages","description":"Needs a full access key. The channel's topic, people and last messages, oldest first, each with its messageId, author, time, replies and the buttons it carries. channel is a channelId, a channel's name (general) or a teammate's name for the DMs with them. threadId reads that message's thread instead.","parameters":[{"name":"channel","in":"path","required":true,"schema":{"type":"string"}},{"name":"threadId","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"channelId":{"type":"string"},"name":{"type":"string"},"messages":{"type":"array","items":{"type":"object"}}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chat/messages":{"post":{"operationId":"postChatMessage","summary":"Post a message in a Team chat channel","description":"Needs a full access key. With text only, posts as the key's person: in a channel (its id or name), to a teammate directly (channel: their name), or to several teammates (people). threadId replies in a thread; mention notifies teammates by name; links adds up to 5 link buttons. With blocks or interaction_url, posts in a channel (required) as an app named after the key, with buttons, menus and pickers: each click is POSTed to interaction_url as Slack's block_actions, signed X-Alori-Signature: v0=HMAC-SHA256(SHA-256 hex of your API key, \"v0:<X-Alori-Request-Timestamp>:<body>\"). Send text, blocks or both. Guide: /api/team-chat.","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string"},"people":{"type":"array","items":{"type":"string"}},"text":{"type":"string"},"threadId":{"type":"string"},"alsoToChannel":{"type":"boolean"},"mention":{"type":"array","items":{"type":"string"}},"links":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"url":{"type":"string"}},"required":["text","url"]}},"blocks":{"type":"array","maxItems":50,"items":{"type":"object"},"description":"Slack Block Kit blocks (section, actions, context, header, divider, image) with buttons, menus, pickers, checkboxes and radio buttons; at most 200 KB of JSON. Posts as an app named after the key. action_ids starting with alori. are refused."},"interaction_url":{"type":"string","format":"uri","maxLength":2000,"description":"https address that receives each click on the message's controls, as Slack's block_actions with a response_url, signed with the SHA-256 hex of your API key."}}}}}},"responses":{"201":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"messageId":{"type":"string"},"channelId":{"type":"string"}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/team":{"get":{"operationId":"listTeam","summary":"List the team","description":"Needs a read or full access key. Everyone who is or was on the team: each person's userId, name, email, role, whether they're an admin, and status (notJoined: brought over from another CRM, can be invited; former: left the team, kept so their records and commissions keep a name; none: an active teammate). invited lists the invitations not accepted yet, with their email. A record's `ownerId` is one of these `userId`s; match people to your own software's users by `email`.","responses":{"200":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"people":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"email":{"type":["string","null"]},"admin":{"type":"boolean"},"role":{"type":["string","null"]},"status":{"enum":["notJoined","former"]}}}},"invited":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"roleId":{"type":"string"},"expired":{"type":"boolean"}}}}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/communications":{"get":{"operationId":"listCommunications","summary":"List calls, emails and texts","description":"Needs a read or full access key. The team's calls, emails, texts, meetings (visit) and messages, newest first, filtered by query parameters: from and to (a day like 2026-11-01 or an ISO time; to is not included), dealId, customerId, companyId, teammate (a userId's name or email), channel (call, email, text, visit, chat, messenger, instagram, comment), direction (in or out), limit (1 to 200, 50 by default) and cursor. Each row has id, channel, direction (null when logged by hand), at (milliseconds since 1970), status, subject, durationSec, teammate ({ id, name, email, status: active, notJoined or former }) and customer, deal and company ({ id, name, path }, the record's page under the app's address, such as /app/deals/<id>). A page can hold fewer rows than limit: read on with cursor until it is null.","responses":{"200":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object"}},"cursor":{"type":["string","null"]}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/bookings":{"get":{"operationId":"listBookings","summary":"List bookings and booking links","description":"Needs a full access key. waiting (requests), upcoming (appointments) and types (booking links: their _id is the bookingLinkId).","responses":{"200":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"waiting":{"type":"array","items":{"type":"object"}},"upcoming":{"type":"array","items":{"type":"object"}},"types":{"type":"array","items":{"type":"object"}}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createBooking","summary":"Book an appointment","description":"Needs a full access key. The customer gets the confirmation email. A taken time is refused (422) unless ignoreAvailability is true.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bookingLinkId":{"type":"string"},"start":{"oneOf":[{"type":"string","format":"date-time"},{"type":"integer","description":"Unix milliseconds"}]},"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"timeZone":{"type":"string"},"location":{"type":"string"},"where":{"type":"string"},"durationMinutes":{"type":"integer"},"ignoreAvailability":{"type":"boolean"}},"required":["bookingLinkId","start","name","email"]}}}},"responses":{"201":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"sent":{"const":true},"bookingId":{"type":"string"}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/bookings/{id}/move":{"post":{"operationId":"moveBooking","summary":"Move a booking","description":"Needs a full access key. The customer and the team are emailed the new time.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"start":{"oneOf":[{"type":"string","format":"date-time"},{"type":"integer","description":"Unix milliseconds"}]},"ignoreAvailability":{"type":"boolean"}},"required":["start"]}}}},"responses":{"200":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"sent":{"const":true}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/bookings/{id}/{answer}":{"post":{"operationId":"answerBooking","summary":"Cancel an appointment, or confirm or decline a request","description":"Needs a full access key. answer is cancel, confirm or decline; reason goes in the customer's email.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"answer","in":"path","required":true,"schema":{"enum":["cancel","confirm","decline"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"sent":{"const":true}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events":{"get":{"operationId":"listEvents","summary":"List calendar events","description":"Needs a full access key. The team's events and Google Calendar or Outlook ones, between from and to (the next two weeks without them).","parameters":[{"name":"from","in":"query","required":false,"schema":{"oneOf":[{"type":"string","format":"date-time"},{"type":"integer","description":"Unix milliseconds"}]}},{"name":"to","in":"query","required":false,"schema":{"oneOf":[{"type":"string","format":"date-time"},{"type":"integer","description":"Unix milliseconds"}]}}],"responses":{"200":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object"}}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createEvent","summary":"Put an event on the calendar, to block time","description":"Needs a full access key. The time shows as busy, so nobody can book it; guests (emails) are invited. Answers eventId, and calendarId for a Google Calendar or Outlook event.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"start":{"oneOf":[{"type":"string","format":"date-time"},{"type":"integer","description":"Unix milliseconds"}]},"durationMinutes":{"type":"integer","default":60},"guests":{"type":"array","items":{"type":"string"}},"location":{"type":"string"},"customerId":{"type":"string"},"dealId":{"type":"string"}},"required":["title","start"]}}}},"responses":{"201":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"eventId":{"type":"string"},"calendarId":{"type":"string"}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events/{id}":{"patch":{"operationId":"updateEvent","summary":"Change an event","description":"Needs a full access key. Only what is sent changes. Send calendarId for a Google Calendar or Outlook event.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"start":{"oneOf":[{"type":"string","format":"date-time"},{"type":"integer","description":"Unix milliseconds"}]},"durationMinutes":{"type":"integer"},"guests":{"type":"array","items":{"type":"string"}},"location":{"type":"string"},"calendarId":{"type":"string"}}}}}},"responses":{"200":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"eventId":{"type":"string"}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"removeEvent","summary":"Remove an event","description":"Needs a full access key. Add calendarId for a Google Calendar or Outlook event.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"calendarId","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/targets":{"get":{"operationId":"listTargetLists","summary":"List target lists","description":"Needs a full access key. Lists of people, and their companies, who don't know the business yet: each with its _id, name, where it came from, people and companies counted, and how many stand at each status (new, sequence, replied, pipeline, customer, unsubscribed, bounced).","responses":{"200":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"lists":{"type":"array","items":{"type":"object"}}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createTargetList","summary":"Make a target list","description":"Needs a full access key. Answers its listId; add rows with POST /v1/targets/{id}/rows.","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}}}}}},"responses":{"201":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"listId":{"type":"string"},"name":{"type":"string"}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/targets/{id}/rows":{"get":{"operationId":"targetListRows","summary":"Read a target list's rows","description":"Needs a full access key. 100 rows a page, newest first; send cursor back while more is true. A company with nobody yet comes with nobodyYet: true and no status. status keeps the people standing there; search finds people by name, email, company or phone.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"enum":["new","sequence","replied","pipeline","customer","unsubscribed","bounced"]}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"list":{"type":"object"},"people":{"type":"array","items":{"type":"object"}},"more":{"type":"boolean"},"cursor":{"type":"string"}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"addTargetRows","summary":"Add people or companies to a target list","description":"Needs a full access key. Up to 1,000 people and 1,000 companies a request. companies: each with its domain (website) and an optional name, on the list with nobody yet; people: rows with an email or a phone; customerIds: people already in the CRM. Everyone is found by email, then phone, and every company by its website, before one is made. Answers added, already and skipped.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"companies":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"domain":{"type":"string"}},"required":["domain"]}},"people":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"phone":{"type":"string"},"name":{"type":"string"},"company":{"type":"string"},"domain":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"}}}},"customerIds":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Done","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"listId":{"type":"string"},"added":{"type":"integer"},"already":{"type":"integer"},"skipped":{"type":"integer"},"summary":{"type":"string"}}}}}},"400":{"description":"`invalidBody`: a field is missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This key can't take actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`recordNotFound` (an id that names nothing) or `notAvailable` (the app lacks the module)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Alori refused it: `details` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 requests a minute per key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`notSent`: the text or email couldn't go out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks":{"get":{"operationId":"listWebhooks","summary":"List the app's webhooks","description":"Needs a full access key.","responses":{"200":{"description":"The webhooks","headers":{"RateLimit-Limit":{"description":"Requests a key may make per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute starts over.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}}}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not a full access key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"addWebhook","summary":"Add a webhook","description":"Needs a full access key. Alori POSTs `{ id, event, occurredAt, recordId, externalId?, changedFields?, source, apiKeyId?, data }` to `url` each time a picked event happens, whatever made the change. `data` is the record as GET /v1/objects reads it (as it was, for a delete); `externalId` is your id when you imported it. `source` is `api` when a /v1 request made the change (`apiKeyId` names its key, so your software can skip its own writes) and `alori` otherwise. Each POST has `Alori-Event` and `Alori-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the secret>`. Answer 2xx within 10 seconds, or Alori retries after 1 min, 5 min, 30 min, 2 h, 6 h and 12 h; `id` is the same on every retry. After 20 failed deliveries in a row the webhook pauses. At most 10 per app.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string","format":"uri","description":"An https address."},"events":{"type":"array","minItems":1,"items":{"enum":["customer.created","customer.updated","customer.deleted","deal.created","deal.updated","deal.deleted","company.created","company.updated","company.deleted","contact.created","contact.updated","contact.deleted","task.created","task.updated","task.deleted","booking.created","booking.updated","booking.cancelled","booking.deleted","note.created","message.received","ticket.created","ticket.updated","ticket.deleted","ticket.commented","record.created","record.updated","record.deleted"]}}}}}}},"responses":{"201":{"description":"Added. `secret` is shown only this once.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"secret":{"type":"string"}}}}}},"400":{"description":"`invalidUrl` or `invalidEvents`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not a full access key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`tooManyWebhooks`: 10 already","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}":{"delete":{"operationId":"removeWebhook","summary":"Remove a webhook","description":"Needs a full access key. What was waiting to be sent to it is dropped.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Removed"},"404":{"description":"`webhookNotFound`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}/test":{"post":{"operationId":"testWebhook","summary":"Send a test event","description":"Needs a full access key. Sends `{ id, event: \"test\", occurredAt, data }`, signed, within seconds.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Queued"},"404":{"description":"`webhookNotFound`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}