{"openapi":"3.0.3","info":{"title":"Kellu API","version":"1.0.0","description":"Read-only public API of Kellu. Authenticate every request with an API key created by an Administrator in Settings → API: `Authorization: Bearer kellu_sk_…`. Errors answer `{ \"error\": { \"code\", \"message\", \"requestId\", \"details\"? } }`; branch on `code`."},"servers":[{"url":"https://api.kellu.co/api/v1"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"API key of the business: `Authorization: Bearer kellu_sk_…`."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_api_key","api_access_disabled","insufficient_scope","not_found","validation_failed","invalid_cursor","rate_limited","internal_error"]},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message","requestId"]}},"required":["error"]}},"parameters":{}},"paths":{"/me":{"get":{"operationId":"get_api_key_info","tags":["API key"],"summary":"Get the business and API key behind the current request","description":"Returns the business the API key belongs to and the key itself (name, prefix, scopes, expiry). Needs no scope: use it to check a key.","security":[{"apiKey":[]}],"responses":{"200":{"description":"The business and the API key of the request.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"business":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"apiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string","description":"First characters of the key (kellu_sk_ + 4)."},"scopes":{"type":"array","items":{"type":"string","enum":["clients:read","work_orders:read","quotes:read","sale_notes:read","assets:read","job_forms:read","catalog:read","team:read","tickets:read"]}},"expiresAt":{"type":"string","nullable":true,"format":"date-time","description":"ISO 8601 UTC; null = never expires."}},"required":["id","name","prefix","scopes","expiresAt"]}},"required":["business","apiKey"]}},"required":["data"]}}}},"401":{"description":"invalid_api_key: the API key is missing, invalid, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"api_access_disabled, or insufficient_scope (details.requiredScope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/clients":{"get":{"operationId":"list_clients","tags":["Clients"],"summary":"List clients","description":"Clients of the business, newest first by default. Ordered by `sortBy` in `order`, ties broken by `id` ascending; pages follow `pagination.nextCursor`. `search` matches the start of any word of the name, contact or company, and digits of the phone or tax id. Requires `clients:read`.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","maxLength":200,"description":"Free-text search."},"required":false,"description":"Free-text search.","name":"search","in":"query"},{"schema":{"type":"string","enum":["ACTIVE","ARCHIVED","FOLLOW_UP"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["name","createdAt","updatedAt"],"default":"createdAt"},"required":false,"name":"sortBy","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"order","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2026-01-31T12:00:00Z","description":"Only rows whose `updatedAt` is at or after this instant (ISO 8601 date-time with zone, `Z` or `±hh:mm`; URL-encode the `+` as `%2B`). For incremental sync use `sortBy=updatedAt&order=asc&updatedSince=<last updatedAt seen>` and re-read with an overlap window (upsert by id): `updatedAt` is stamped before the change commits. Not reported, use the webhooks for them: deletions; a change in a child record that does not touch the parent `updatedAt`; derived values that change without touching the row — a sale note `status`, `amountPaidClp` and `balanceClp` (payments), a work order `saleNoteStatus`."},"required":false,"description":"Only rows whose `updatedAt` is at or after this instant (ISO 8601 date-time with zone, `Z` or `±hh:mm`; URL-encode the `+` as `%2B`). For incremental sync use `sortBy=updatedAt&order=asc&updatedSince=<last updatedAt seen>` and re-read with an overlap window (upsert by id): `updatedAt` is stamped before the change commits. Not reported, use the webhooks for them: deletions; a change in a child record that does not touch the parent `updatedAt`; derived values that change without touching the row — a sale note `status`, `amountPaidClp` and `balanceClp` (payments), a work order `saleNoteStatus`.","name":"updatedSince","in":"query"},{"schema":{"type":"string","description":"Opaque cursor: the `pagination.nextCursor` of the previous page; omit it for the first page. Send it with the SAME other parameters (filters, `sortBy`, `order`) as the request that returned it, or the API answers 400 `invalid_cursor`. `limit` may change between pages."},"required":false,"description":"Opaque cursor: the `pagination.nextCursor` of the previous page; omit it for the first page. Send it with the SAME other parameters (filters, `sortBy`, `order`) as the request that returned it, or the API answers 400 `invalid_cursor`. `limit` may change between pages.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Items per page, 1–100 (default 25)."},"required":false,"description":"Items per page, 1–100 (default 25).","name":"limit","in":"query"}],"responses":{"200":{"description":"One page of clients.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","description":"Display name (company or contact, per the client)."},"contactName":{"type":"string"},"companyName":{"type":"string","nullable":true},"documentNumber":{"type":"string","nullable":true,"description":"Tax id of the client (RUT in Chile)."},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"status":{"type":"string","enum":["ACTIVE","ARCHIVED","FOLLOW_UP"]},"address":{"type":"string","nullable":true,"description":"Formatted text of the default address; null without address."},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["id","name","contactName","companyName","documentNumber","email","phone","status","address","tags"]}},"pagination":{"type":"object","properties":{"nextCursor":{"type":"string","nullable":true,"description":"Pass it as `cursor` to read the next page; null = this is the last page."},"hasMore":{"type":"boolean","description":"true ⇔ `nextCursor` is not null."}},"required":["nextCursor","hasMore"]}},"required":["data","pagination"]}}}},"400":{"description":"validation_failed: the request is invalid (details carries the issues; an unknown query parameter is rejected too). A transport-level rejection (405, 413, 415…) also answers validation_failed, with that status. invalid_cursor (lists): the cursor is unreadable or was issued for other parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"invalid_api_key: the API key is missing, invalid, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"api_access_disabled, or insufficient_scope (details.requiredScope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/clients/{clientId}":{"get":{"operationId":"get_client","tags":["Clients"],"summary":"Get a client with its addresses and contacts","description":"One client with its active addresses (default first) and its contacts (primary first). Requires `clients:read`.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"clientId","in":"path"}],"responses":{"200":{"description":"The client.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","description":"Display name (company or contact, per the client)."},"contactName":{"type":"string"},"companyName":{"type":"string","nullable":true},"documentNumber":{"type":"string","nullable":true,"description":"Tax id of the client (RUT in Chile)."},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"status":{"type":"string","enum":["ACTIVE","ARCHIVED","FOLLOW_UP"]},"address":{"type":"string","nullable":true,"description":"Formatted text of the default address; null without address."},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"locations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true,"description":"Alias of the address, e.g. \"Warehouse\"."},"formattedAddress":{"type":"string"},"street":{"type":"string","nullable":true},"streetNumber":{"type":"string","nullable":true},"addressLine2":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"region":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"latitude":{"type":"number","nullable":true},"longitude":{"type":"number","nullable":true},"isDefault":{"type":"boolean"}},"required":["id","name","formattedAddress","street","streetNumber","addressLine2","city","region","postalCode","country","latitude","longitude","isDefault"]}},"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"isPrimary":{"type":"boolean"}},"required":["id","name","email","phone","isPrimary"]}},"lastActivityAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","contactName","companyName","documentNumber","email","phone","status","address","tags","locations","contacts","lastActivityAt","createdAt","updatedAt"]}},"required":["data"]}}}},"401":{"description":"invalid_api_key: the API key is missing, invalid, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"api_access_disabled, or insufficient_scope (details.requiredScope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: the resource does not exist for this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/work-orders":{"get":{"operationId":"list_work_orders","tags":["Work orders"],"summary":"List work orders","description":"Work orders of the business, every job status included (also NOT_REQUIRED). `jobStatus` in the response is derived at read time, so this endpoint has no `jobStatus` filter. `dateFrom`/`dateTo` filter the scheduled date (calendar days in the business zone, inclusive); with a date filter, unscheduled work orders are left out. Ordered by `sortBy` in `order`, ties broken by `id` descending whatever the order; with `sortBy=scheduledAt` unscheduled work orders come LAST in both orders. Pages follow `pagination.nextCursor`. `startTime`/`endTime` are business-local wall-clock times, see `timeZone`. Requires `work_orders:read`.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","maxLength":200,"description":"Matches title, address, client name or number."},"required":false,"description":"Matches title, address, client name or number.","name":"search","in":"query"},{"schema":{"type":"string"},"required":false,"name":"clientId","in":"query"},{"schema":{"type":"string","format":"date","example":"2026-01-31","description":"First scheduled day (YYYY-MM-DD)."},"required":false,"description":"First scheduled day (YYYY-MM-DD).","name":"dateFrom","in":"query"},{"schema":{"type":"string","format":"date","example":"2026-01-31","description":"Last scheduled day (YYYY-MM-DD), inclusive."},"required":false,"description":"Last scheduled day (YYYY-MM-DD), inclusive.","name":"dateTo","in":"query"},{"schema":{"type":"string","enum":["createdAt","updatedAt","scheduledAt"],"default":"createdAt"},"required":false,"name":"sortBy","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"order","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2026-01-31T12:00:00Z","description":"Only rows whose `updatedAt` is at or after this instant (ISO 8601 date-time with zone, `Z` or `±hh:mm`; URL-encode the `+` as `%2B`). For incremental sync use `sortBy=updatedAt&order=asc&updatedSince=<last updatedAt seen>` and re-read with an overlap window (upsert by id): `updatedAt` is stamped before the change commits. Not reported, use the webhooks for them: deletions; a change in a child record that does not touch the parent `updatedAt`; derived values that change without touching the row — a sale note `status`, `amountPaidClp` and `balanceClp` (payments), a work order `saleNoteStatus`."},"required":false,"description":"Only rows whose `updatedAt` is at or after this instant (ISO 8601 date-time with zone, `Z` or `±hh:mm`; URL-encode the `+` as `%2B`). For incremental sync use `sortBy=updatedAt&order=asc&updatedSince=<last updatedAt seen>` and re-read with an overlap window (upsert by id): `updatedAt` is stamped before the change commits. Not reported, use the webhooks for them: deletions; a change in a child record that does not touch the parent `updatedAt`; derived values that change without touching the row — a sale note `status`, `amountPaidClp` and `balanceClp` (payments), a work order `saleNoteStatus`.","name":"updatedSince","in":"query"},{"schema":{"type":"string","description":"Opaque cursor: the `pagination.nextCursor` of the previous page; omit it for the first page. Send it with the SAME other parameters (filters, `sortBy`, `order`) as the request that returned it, or the API answers 400 `invalid_cursor`. `limit` may change between pages."},"required":false,"description":"Opaque cursor: the `pagination.nextCursor` of the previous page; omit it for the first page. Send it with the SAME other parameters (filters, `sortBy`, `order`) as the request that returned it, or the API answers 400 `invalid_cursor`. `limit` may change between pages.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Items per page, 1–100 (default 25)."},"required":false,"description":"Items per page, 1–100 (default 25).","name":"limit","in":"query"}],"responses":{"200":{"description":"One page of work orders.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string","nullable":true,"description":"Work order number, e.g. \"#120\"."},"title":{"type":"string","nullable":true},"jobStatus":{"type":"string","enum":["UNSCHEDULED","UNASSIGNED","SCHEDULED","ON_MY_WAY","IN_PROGRESS","COMPLETED","NOT_REQUIRED"],"description":"Derived job status (planning states are computed at read time from schedule and assignees)."},"quoteStatus":{"type":"string","enum":["NOT_REQUIRED","DRAFT","AWAITING_RESPONSE","APPROVED","ARCHIVED","NOT_APPROVED"]},"saleNoteStatus":{"type":"string","enum":["NOT_REQUIRED","DRAFT","AWAITING_PAYMENT","OVERDUE","PAID","CLOSED_UNPAID","BAD_DEBT"],"description":"Sale note status of the work order (OVERDUE is derived at read time; CLOSED_UNPAID = closed without registering a payment). Same value as the sale note `status` once issued."},"scheduledAt":{"type":"string","nullable":true,"format":"date-time"},"startTime":{"type":"string","nullable":true,"description":"Business-local wall-clock time \"HH:mm\", see `timeZone`. null = no time.","example":"09:30"},"endTime":{"type":"string","nullable":true,"description":"Business-local wall-clock time \"HH:mm\", see `timeZone`. null = no time.","example":"09:30"},"isAnyTime":{"type":"boolean"},"completedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"client":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"location":{"type":"object","nullable":true,"properties":{"formattedAddress":{"type":"string"},"city":{"type":"string","nullable":true},"region":{"type":"string","nullable":true},"latitude":{"type":"number","nullable":true},"longitude":{"type":"number","nullable":true}},"required":["formattedAddress","city","region","latitude","longitude"]},"category":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"assignees":{"type":"array","items":{"type":"object","properties":{"memberId":{"type":"string"},"name":{"type":"string","nullable":true}},"required":["memberId","name"]}},"visitCount":{"type":"integer"}},"required":["id","number","title","jobStatus","quoteStatus","saleNoteStatus","scheduledAt","startTime","endTime","isAnyTime","completedAt","createdAt","updatedAt","client","location","category","assignees","visitCount"]}},"pagination":{"type":"object","properties":{"nextCursor":{"type":"string","nullable":true,"description":"Pass it as `cursor` to read the next page; null = this is the last page."},"hasMore":{"type":"boolean","description":"true ⇔ `nextCursor` is not null."}},"required":["nextCursor","hasMore"]},"timeZone":{"type":"string","description":"IANA time zone of the business. `startTime`/`endTime` are business-local wall-clock times in it.","example":"America/Santiago"}},"required":["data","pagination","timeZone"]}}}},"400":{"description":"validation_failed: the request is invalid (details carries the issues; an unknown query parameter is rejected too). A transport-level rejection (405, 413, 415…) also answers validation_failed, with that status. invalid_cursor (lists): the cursor is unreadable or was issued for other parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"invalid_api_key: the API key is missing, invalid, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"api_access_disabled, or insufficient_scope (details.requiredScope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/work-orders/{workOrderId}":{"get":{"operationId":"get_work_order","tags":["Work orders"],"summary":"Get a work order with its visits, line items, equipment and reports","description":"One work order: visits, line items (no prices), linked equipment and attached job forms (reports). The client email/phone and the work order contact are null unless the key also has `clients:read`. `startTime`/`endTime` are business-local wall-clock times, see `timeZone`. Requires `work_orders:read`.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"workOrderId","in":"path"}],"responses":{"200":{"description":"The work order.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string","nullable":true,"description":"Work order number, e.g. \"#120\"."},"title":{"type":"string","nullable":true},"jobStatus":{"type":"string","enum":["UNSCHEDULED","UNASSIGNED","SCHEDULED","ON_MY_WAY","IN_PROGRESS","COMPLETED","NOT_REQUIRED"],"description":"Derived job status (planning states are computed at read time from schedule and assignees)."},"quoteStatus":{"type":"string","enum":["NOT_REQUIRED","DRAFT","AWAITING_RESPONSE","APPROVED","ARCHIVED","NOT_APPROVED"]},"saleNoteStatus":{"type":"string","enum":["NOT_REQUIRED","DRAFT","AWAITING_PAYMENT","OVERDUE","PAID","CLOSED_UNPAID","BAD_DEBT"],"description":"Sale note status of the work order (OVERDUE is derived at read time; CLOSED_UNPAID = closed without registering a payment). Same value as the sale note `status` once issued."},"scheduledAt":{"type":"string","nullable":true,"format":"date-time"},"startTime":{"type":"string","nullable":true,"description":"Business-local wall-clock time \"HH:mm\", see `timeZone`. null = no time.","example":"09:30"},"endTime":{"type":"string","nullable":true,"description":"Business-local wall-clock time \"HH:mm\", see `timeZone`. null = no time.","example":"09:30"},"isAnyTime":{"type":"boolean"},"completedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"client":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","nullable":true,"description":"Always null unless the key also has `clients:read`."},"phone":{"type":"string","nullable":true,"description":"Always null unless the key also has `clients:read`."}},"required":["id","name","email","phone"]},"location":{"type":"object","nullable":true,"properties":{"formattedAddress":{"type":"string"},"city":{"type":"string","nullable":true},"region":{"type":"string","nullable":true},"latitude":{"type":"number","nullable":true},"longitude":{"type":"number","nullable":true}},"required":["formattedAddress","city","region","latitude","longitude"]},"category":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"assignees":{"type":"array","items":{"type":"object","properties":{"memberId":{"type":"string"},"name":{"type":"string","nullable":true}},"required":["memberId","name"]}},"visitCount":{"type":"integer"},"timeZone":{"type":"string","description":"IANA time zone of the business. `startTime`/`endTime` are business-local wall-clock times in it.","example":"America/Santiago"},"contact":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true}},"required":["name","email","phone"],"description":"Contact of the client for this work order. null when the work order uses the client primary contact, and ALWAYS null unless the key also has `clients:read`."},"visits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string","nullable":true},"status":{"type":"string","enum":["SCHEDULED","ON_MY_WAY","IN_PROGRESS","COMPLETED"]},"scheduledAt":{"type":"string","nullable":true,"format":"date-time"},"startTime":{"type":"string","nullable":true,"description":"Business-local wall-clock time \"HH:mm\", see `timeZone`. null = no time.","example":"09:30"},"endTime":{"type":"string","nullable":true,"description":"Business-local wall-clock time \"HH:mm\", see `timeZone`. null = no time.","example":"09:30"},"startedAt":{"type":"string","nullable":true,"format":"date-time"},"completedAt":{"type":"string","nullable":true,"format":"date-time"},"assignees":{"type":"array","items":{"type":"object","properties":{"memberId":{"type":"string"},"name":{"type":"string","nullable":true}},"required":["memberId","name"]}}},"required":["id","label","status","scheduledAt","startTime","endTime","startedAt","completedAt","assignees"]}},"lineItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"itemType":{"type":"string","enum":["SERVICE","PRODUCT"]},"description":{"type":"string","nullable":true},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"groupName":{"type":"string","nullable":true},"billable":{"type":"boolean","description":"false = internal material, not charged."}},"required":["id","name","itemType","description","quantity","unit","groupName","billable"]}},"assets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"jobForms":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"templateId":{"type":"string","nullable":true},"name":{"type":"string"},"submittedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","templateId","name","submittedAt"]}}},"required":["id","number","title","jobStatus","quoteStatus","saleNoteStatus","scheduledAt","startTime","endTime","isAnyTime","completedAt","createdAt","updatedAt","client","location","category","assignees","visitCount","timeZone","contact","visits","lineItems","assets","jobForms"]}},"required":["data"]}}}},"401":{"description":"invalid_api_key: the API key is missing, invalid, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"api_access_disabled, or insufficient_scope (details.requiredScope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: the resource does not exist for this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/visits":{"get":{"operationId":"list_visits","tags":["Work orders"],"summary":"List work order visits between two days","description":"Visits of work orders whose calendar day (in the business zone, `timeZone`) is between `from` and `to`, both inclusive; at most 31 days. Ordered by `scheduledAt`, then `visitId`; pages follow `pagination.nextCursor` (the list is recomputed on every request: a visit rescheduled between two pages can be skipped or repeated). Tasks and visits without a date are not listed; neither are work orders whose job is NOT_REQUIRED. `status` is the planning status of the visit. Requires `work_orders:read`.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"date","example":"2026-01-31","description":"First day (YYYY-MM-DD), business zone."},"required":true,"description":"First day (YYYY-MM-DD), business zone.","name":"from","in":"query"},{"schema":{"type":"string","format":"date","example":"2026-01-31","description":"Last day (YYYY-MM-DD). The range may span at most 31 days, both ends included."},"required":true,"description":"Last day (YYYY-MM-DD). The range may span at most 31 days, both ends included.","name":"to","in":"query"},{"schema":{"type":"string","description":"Opaque cursor: the `pagination.nextCursor` of the previous page; omit it for the first page. Send it with the SAME other parameters (filters, `sortBy`, `order`) as the request that returned it, or the API answers 400 `invalid_cursor`. `limit` may change between pages."},"required":false,"description":"Opaque cursor: the `pagination.nextCursor` of the previous page; omit it for the first page. Send it with the SAME other parameters (filters, `sortBy`, `order`) as the request that returned it, or the API answers 400 `invalid_cursor`. `limit` may change between pages.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Items per page, 1–100 (default 25)."},"required":false,"description":"Items per page, 1–100 (default 25).","name":"limit","in":"query"}],"responses":{"200":{"description":"One page of visits.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"visitId":{"type":"string"},"workOrderId":{"type":"string"},"workOrderNumber":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"string","enum":["UNASSIGNED","SCHEDULED","ON_MY_WAY","IN_PROGRESS","COMPLETED"],"description":"Planning status of the visit: UNASSIGNED = scheduled without technician; SCHEDULED, ON_MY_WAY, IN_PROGRESS, COMPLETED as executed by the technician."},"scheduledAt":{"type":"string","format":"date-time"},"startTime":{"type":"string","nullable":true,"description":"Business-local wall-clock time \"HH:mm\", see `timeZone`. null = no time.","example":"09:30"},"endTime":{"type":"string","nullable":true,"description":"Business-local wall-clock time \"HH:mm\", see `timeZone`. null = no time.","example":"09:30"},"isAnyTime":{"type":"boolean","description":"true = dated visit without a start time."},"completedAt":{"type":"string","nullable":true,"format":"date-time"},"client":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"location":{"type":"object","nullable":true,"properties":{"formattedAddress":{"type":"string"},"city":{"type":"string","nullable":true},"region":{"type":"string","nullable":true}},"required":["formattedAddress","city","region"]},"assignees":{"type":"array","items":{"type":"object","properties":{"memberId":{"type":"string"},"name":{"type":"string","nullable":true}},"required":["memberId","name"]}}},"required":["visitId","workOrderId","workOrderNumber","title","status","scheduledAt","startTime","endTime","isAnyTime","completedAt","client","location","assignees"]}},"pagination":{"type":"object","properties":{"nextCursor":{"type":"string","nullable":true,"description":"Pass it as `cursor` to read the next page; null = this is the last page."},"hasMore":{"type":"boolean","description":"true ⇔ `nextCursor` is not null."}},"required":["nextCursor","hasMore"]},"timeZone":{"type":"string","description":"IANA time zone of the business. `startTime`/`endTime` are business-local wall-clock times in it.","example":"America/Santiago"}},"required":["data","pagination","timeZone"]}}}},"400":{"description":"validation_failed: the request is invalid (details carries the issues; an unknown query parameter is rejected too). A transport-level rejection (405, 413, 415…) also answers validation_failed, with that status. invalid_cursor (lists): the cursor is unreadable or was issued for other parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"invalid_api_key: the API key is missing, invalid, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"api_access_disabled, or insufficient_scope (details.requiredScope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/work-orders/{workOrderId}/job-forms":{"get":{"operationId":"list_work_order_job_forms","tags":["Job forms"],"summary":"List the job forms (reports) of a work order","description":"Job forms attached to one work order, oldest first, submitted or not. Requires `job_forms:read`.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"workOrderId","in":"path"}],"responses":{"200":{"description":"The job forms of the work order.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"templateId":{"type":"string","nullable":true},"name":{"type":"string"},"isRequired":{"type":"boolean"},"submittedAt":{"type":"string","nullable":true,"format":"date-time","description":"null = not submitted yet."},"submittedByName":{"type":"string","nullable":true},"reportNumber":{"type":"string","nullable":true,"description":"Report number derived from the work order number, e.g. \"#120-2\"."},"visitId":{"type":"string","nullable":true},"assetId":{"type":"string","nullable":true},"itemName":{"type":"string","nullable":true,"description":"Equipment the report is about."},"isFollowUp":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","templateId","name","isRequired","submittedAt","submittedByName","reportNumber","visitId","assetId","itemName","isFollowUp","createdAt"]}}},"required":["data"]}}}},"400":{"description":"validation_failed: the request is invalid (details carries the issues; an unknown query parameter is rejected too). A transport-level rejection (405, 413, 415…) also answers validation_failed, with that status. invalid_cursor (lists): the cursor is unreadable or was issued for other parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"invalid_api_key: the API key is missing, invalid, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"api_access_disabled, or insufficient_scope (details.requiredScope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: the resource does not exist for this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/job-form-templates":{"get":{"operationId":"list_job_form_templates","tags":["Job forms"],"summary":"List job form templates","description":"Every job form template of the business, newest first, archived ones included (`archivedAt` set). Each template lists its answerable fields (layout-only blocks left out). Requires `job_forms:read`.","security":[{"apiKey":[]}],"responses":{"200":{"description":"The templates.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"archivedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","description":"Field type, e.g. SHORT_TEXT, NUMBER, MATRIX."},"required":{"type":"boolean"}},"required":["id","label","type","required"]}}},"required":["id","name","archivedAt","createdAt","updatedAt","fields"]}}},"required":["data"]}}}},"400":{"description":"validation_failed: the request is invalid (details carries the issues; an unknown query parameter is rejected too). A transport-level rejection (405, 413, 415…) also answers validation_failed, with that status. invalid_cursor (lists): the cursor is unreadable or was issued for other parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"invalid_api_key: the API key is missing, invalid, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"api_access_disabled, or insufficient_scope (details.requiredScope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/job-form-templates/{templateId}/submissions":{"get":{"operationId":"list_job_form_submissions","tags":["Job forms"],"summary":"List submitted job forms of a template, answers as text","description":"Submitted job forms of one template between `from` and `to` (submission day in the business zone, both inclusive; at most 31 days), newest first (ties broken by `formId`); `rows` pages follow `pagination.nextCursor`.`columns` is the union of the template fields seen in the period; `rows[].answers` maps column id → answer as text. Image fields are not included. Follow-up reports are not included. `truncated: true` = only the 5000 most recent submissions of the range were considered. Requires `job_forms:read`.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"templateId","in":"path"},{"schema":{"type":"string","format":"date","example":"2026-01-31","description":"First submission day (YYYY-MM-DD), business zone."},"required":true,"description":"First submission day (YYYY-MM-DD), business zone.","name":"from","in":"query"},{"schema":{"type":"string","format":"date","example":"2026-01-31","description":"Last submission day (YYYY-MM-DD), inclusive."},"required":true,"description":"Last submission day (YYYY-MM-DD), inclusive.","name":"to","in":"query"},{"schema":{"type":"string","description":"Opaque cursor: the `pagination.nextCursor` of the previous page; omit it for the first page. Send it with the SAME other parameters (filters, `sortBy`, `order`) as the request that returned it, or the API answers 400 `invalid_cursor`. `limit` may change between pages."},"required":false,"description":"Opaque cursor: the `pagination.nextCursor` of the previous page; omit it for the first page. Send it with the SAME other parameters (filters, `sortBy`, `order`) as the request that returned it, or the API answers 400 `invalid_cursor`. `limit` may change between pages.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Items per page, 1–100 (default 25)."},"required":false,"description":"Items per page, 1–100 (default 25).","name":"limit","in":"query"}],"responses":{"200":{"description":"One page of submissions.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"template":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"columns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"}},"required":["id","label","type"]}},"rows":{"type":"array","items":{"type":"object","properties":{"formId":{"type":"string"},"workOrderId":{"type":"string"},"workOrderNumber":{"type":"string","nullable":true},"reportNumber":{"type":"string","nullable":true},"clientId":{"type":"string","nullable":true},"clientName":{"type":"string","nullable":true},"itemName":{"type":"string","nullable":true},"submittedByName":{"type":"string","nullable":true},"submittedAt":{"type":"string","format":"date-time"},"answers":{"type":"object","additionalProperties":{"type":"string"},"description":"Answer text by column id (`columns[].id`). Image fields are not included."}},"required":["formId","workOrderId","workOrderNumber","reportNumber","clientId","clientName","itemName","submittedByName","submittedAt","answers"]}}},"required":["template","columns","rows"]},"pagination":{"type":"object","properties":{"nextCursor":{"type":"string","nullable":true,"description":"Pass it as `cursor` to read the next page; null = this is the last page."},"hasMore":{"type":"boolean","description":"true ⇔ `nextCursor` is not null."}},"required":["nextCursor","hasMore"]},"truncated":{"type":"boolean","description":"true = the range has more than 5000 submissions and only the 5000 most recent were considered: narrow the range."}},"required":["data","pagination","truncated"]}}}},"400":{"description":"validation_failed: the request is invalid (details carries the issues; an unknown query parameter is rejected too). A transport-level rejection (405, 413, 415…) also answers validation_failed, with that status. invalid_cursor (lists): the cursor is unreadable or was issued for other parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"invalid_api_key: the API key is missing, invalid, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"api_access_disabled, or insufficient_scope (details.requiredScope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: the resource does not exist for this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/quotes":{"get":{"operationId":"list_quotes","tags":["Quotes"],"summary":"List quotes","description":"Emitted quotes of the business, newest first by default. Ordered by `sortBy` in `order`, ties broken by `id` in the same direction; pages follow `pagination.nextCursor`. Only ISSUED documents exist here (issued = sent through Kellu or marked as sent/awaiting payment by the business): a document never issued is not listed and answers 404 by id. The amounts and lines are those of the issued version (the approved one, else the last one issued); only billable lines are included. Closed quotes are listed only on request, with `status=ARCHIVED` or `status=NOT_APPROVED` (by id they always resolve). Requires `quotes:read`.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","enum":["DRAFT","AWAITING_RESPONSE","APPROVED","ARCHIVED","NOT_APPROVED"],"description":"Quote status (DRAFT = being revised after having been issued). Without it, archived quotes are left out."},"required":false,"description":"Quote status (DRAFT = being revised after having been issued). Without it, archived quotes are left out.","name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"clientId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"workOrderId","in":"query"},{"schema":{"type":"string","format":"date","example":"2026-01-31","description":"First creation day (YYYY-MM-DD), business zone."},"required":false,"description":"First creation day (YYYY-MM-DD), business zone.","name":"dateFrom","in":"query"},{"schema":{"type":"string","format":"date","example":"2026-01-31","description":"Last creation day (YYYY-MM-DD), inclusive."},"required":false,"description":"Last creation day (YYYY-MM-DD), inclusive.","name":"dateTo","in":"query"},{"schema":{"type":"string","enum":["createdAt","updatedAt"],"default":"createdAt"},"required":false,"name":"sortBy","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"order","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2026-01-31T12:00:00Z","description":"Only rows whose `updatedAt` is at or after this instant (ISO 8601 date-time with zone, `Z` or `±hh:mm`; URL-encode the `+` as `%2B`). For incremental sync use `sortBy=updatedAt&order=asc&updatedSince=<last updatedAt seen>` and re-read with an overlap window (upsert by id): `updatedAt` is stamped before the change commits. Not reported, use the webhooks for them: deletions; a change in a child record that does not touch the parent `updatedAt`; derived values that change without touching the row — a sale note `status`, `amountPaidClp` and `balanceClp` (payments), a work order `saleNoteStatus`."},"required":false,"description":"Only rows whose `updatedAt` is at or after this instant (ISO 8601 date-time with zone, `Z` or `±hh:mm`; URL-encode the `+` as `%2B`). For incremental sync use `sortBy=updatedAt&order=asc&updatedSince=<last updatedAt seen>` and re-read with an overlap window (upsert by id): `updatedAt` is stamped before the change commits. Not reported, use the webhooks for them: deletions; a change in a child record that does not touch the parent `updatedAt`; derived values that change without touching the row — a sale note `status`, `amountPaidClp` and `balanceClp` (payments), a work order `saleNoteStatus`.","name":"updatedSince","in":"query"},{"schema":{"type":"string","description":"Opaque cursor: the `pagination.nextCursor` of the previous page; omit it for the first page. Send it with the SAME other parameters (filters, `sortBy`, `order`) as the request that returned it, or the API answers 400 `invalid_cursor`. `limit` may change between pages."},"required":false,"description":"Opaque cursor: the `pagination.nextCursor` of the previous page; omit it for the first page. Send it with the SAME other parameters (filters, `sortBy`, `order`) as the request that returned it, or the API answers 400 `invalid_cursor`. `limit` may change between pages.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Items per page, 1–100 (default 25)."},"required":false,"description":"Items per page, 1–100 (default 25).","name":"limit","in":"query"}],"responses":{"200":{"description":"One page of quotes.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"sentAt":{"type":"string","nullable":true,"format":"date-time","description":"When the issued version was sent through Kellu; null when the business marked it as sent/awaiting payment by hand."},"workOrder":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string","nullable":true},"title":{"type":"string","nullable":true}},"required":["id","number","title"]},"status":{"type":"string","enum":["DRAFT","AWAITING_RESPONSE","APPROVED","ARCHIVED","NOT_APPROVED"],"description":"Quote status. DRAFT means the document is being revised after having been issued; amounts are those of the last issued version. Documents never issued are not returned (issued = sent through Kellu or marked as sent/awaiting payment by the business)."},"client":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"currency":{"type":"string","enum":["CLP","UF"],"description":"Currency of every amount of the document."},"total":{"type":"number"},"ufValue":{"type":"number","nullable":true,"description":"CLP value of 1 UF frozen when the document was emitted; null in CLP."}},"required":["id","number","createdAt","updatedAt","sentAt","workOrder","status","client","currency","total","ufValue"]}},"pagination":{"type":"object","properties":{"nextCursor":{"type":"string","nullable":true,"description":"Pass it as `cursor` to read the next page; null = this is the last page."},"hasMore":{"type":"boolean","description":"true ⇔ `nextCursor` is not null."}},"required":["nextCursor","hasMore"]}},"required":["data","pagination"]}}}},"400":{"description":"validation_failed: the request is invalid (details carries the issues; an unknown query parameter is rejected too). A transport-level rejection (405, 413, 415…) also answers validation_failed, with that status. invalid_cursor (lists): the cursor is unreadable or was issued for other parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"invalid_api_key: the API key is missing, invalid, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"api_access_disabled, or insufficient_scope (details.requiredScope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/quotes/{quoteId}":{"get":{"operationId":"get_quote","tags":["Quotes"],"summary":"Get a quote with its amounts and lines","description":"One emitted quote. Only ISSUED documents exist here (issued = sent through Kellu or marked as sent/awaiting payment by the business): a document never issued is not listed and answers 404 by id. The amounts and lines are those of the issued version (the approved one, else the last one issued); only billable lines are included. Amounts are in `currency`. The client email/phone are null unless the key also has `clients:read`. Requires `quotes:read`.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"quoteId","in":"path"}],"responses":{"200":{"description":"The quote.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"sentAt":{"type":"string","nullable":true,"format":"date-time","description":"When the issued version was sent through Kellu; null when the business marked it as sent/awaiting payment by hand."},"workOrder":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string","nullable":true},"title":{"type":"string","nullable":true}},"required":["id","number","title"]},"status":{"type":"string","enum":["DRAFT","AWAITING_RESPONSE","APPROVED","ARCHIVED","NOT_APPROVED"],"description":"Quote status. DRAFT means the document is being revised after having been issued; amounts are those of the last issued version. Documents never issued are not returned (issued = sent through Kellu or marked as sent/awaiting payment by the business)."},"client":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","nullable":true,"description":"Always null unless the key also has `clients:read`."},"phone":{"type":"string","nullable":true,"description":"Always null unless the key also has `clients:read`."}},"required":["id","name","email","phone"]},"approvedAt":{"type":"string","nullable":true,"format":"date-time"},"expiresAt":{"type":"string","nullable":true,"format":"date-time","description":"Validity of the quote; null = none."},"currency":{"type":"string","enum":["CLP","UF"],"description":"Currency of every amount of the document."},"total":{"type":"number"},"ufValue":{"type":"number","nullable":true,"description":"CLP value of 1 UF frozen when the document was emitted; null in CLP."},"pricesIncludeIva":{"type":"boolean","description":"true = line prices include IVA (gross)."},"subtotal":{"type":"number","nullable":true},"discount":{"type":"number","nullable":true},"discountType":{"type":"string","nullable":true,"enum":["PERCENTAGE","AMOUNT"]},"tax":{"type":"number","nullable":true},"taxPercent":{"type":"number","nullable":true},"chargedExpensesTotal":{"type":"number","description":"Expenses charged to the client, included in total (in `currency`)."},"lineItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"itemType":{"type":"string","enum":["SERVICE","PRODUCT"]},"description":{"type":"string","nullable":true},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"price":{"type":"number","description":"Unit price in `currency`."},"groupName":{"type":"string","nullable":true}},"required":["id","name","itemType","description","quantity","unit","price","groupName"]}}},"required":["id","number","createdAt","updatedAt","sentAt","workOrder","status","client","approvedAt","expiresAt","currency","total","ufValue","pricesIncludeIva","subtotal","discount","discountType","tax","taxPercent","chargedExpensesTotal","lineItems"]}},"required":["data"]}}}},"401":{"description":"invalid_api_key: the API key is missing, invalid, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"api_access_disabled, or insufficient_scope (details.requiredScope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: the resource does not exist for this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sale-notes":{"get":{"operationId":"list_sale_notes","tags":["Sale notes"],"summary":"List sale notes","description":"Emitted sale notes of the business, newest first by default. Ordered by `sortBy` in `order`, ties broken by `id` in the same direction; pages follow `pagination.nextCursor`. Only ISSUED documents exist here (issued = sent through Kellu or marked as sent/awaiting payment by the business): a document never issued is not listed and answers 404 by id. The amounts and lines are those of the issued version (the approved one, else the last one issued); only billable lines are included. `total` is in `currency`; `balanceClp` is always CLP. Requires `sale_notes:read`.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","enum":["DRAFT","AWAITING_PAYMENT","OVERDUE","PAID","CLOSED_UNPAID","BAD_DEBT","NOT_REQUIRED"],"description":"Collection status (OVERDUE = awaiting payment past its due date; CLOSED_UNPAID = closed without payment, not included in PAID; DRAFT = being revised after having been issued)."},"required":false,"description":"Collection status (OVERDUE = awaiting payment past its due date; CLOSED_UNPAID = closed without payment, not included in PAID; DRAFT = being revised after having been issued).","name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"clientId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"workOrderId","in":"query"},{"schema":{"type":"string","format":"date","example":"2026-01-31","description":"First creation day (YYYY-MM-DD), business zone."},"required":false,"description":"First creation day (YYYY-MM-DD), business zone.","name":"dateFrom","in":"query"},{"schema":{"type":"string","format":"date","example":"2026-01-31","description":"Last creation day (YYYY-MM-DD), inclusive."},"required":false,"description":"Last creation day (YYYY-MM-DD), inclusive.","name":"dateTo","in":"query"},{"schema":{"type":"string","enum":["createdAt","updatedAt"],"default":"createdAt"},"required":false,"name":"sortBy","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"order","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2026-01-31T12:00:00Z","description":"Only rows whose `updatedAt` is at or after this instant (ISO 8601 date-time with zone, `Z` or `±hh:mm`; URL-encode the `+` as `%2B`). For incremental sync use `sortBy=updatedAt&order=asc&updatedSince=<last updatedAt seen>` and re-read with an overlap window (upsert by id): `updatedAt` is stamped before the change commits. Not reported, use the webhooks for them: deletions; a change in a child record that does not touch the parent `updatedAt`; derived values that change without touching the row — a sale note `status`, `amountPaidClp` and `balanceClp` (payments), a work order `saleNoteStatus`."},"required":false,"description":"Only rows whose `updatedAt` is at or after this instant (ISO 8601 date-time with zone, `Z` or `±hh:mm`; URL-encode the `+` as `%2B`). For incremental sync use `sortBy=updatedAt&order=asc&updatedSince=<last updatedAt seen>` and re-read with an overlap window (upsert by id): `updatedAt` is stamped before the change commits. Not reported, use the webhooks for them: deletions; a change in a child record that does not touch the parent `updatedAt`; derived values that change without touching the row — a sale note `status`, `amountPaidClp` and `balanceClp` (payments), a work order `saleNoteStatus`.","name":"updatedSince","in":"query"},{"schema":{"type":"string","description":"Opaque cursor: the `pagination.nextCursor` of the previous page; omit it for the first page. Send it with the SAME other parameters (filters, `sortBy`, `order`) as the request that returned it, or the API answers 400 `invalid_cursor`. `limit` may change between pages."},"required":false,"description":"Opaque cursor: the `pagination.nextCursor` of the previous page; omit it for the first page. Send it with the SAME other parameters (filters, `sortBy`, `order`) as the request that returned it, or the API answers 400 `invalid_cursor`. `limit` may change between pages.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Items per page, 1–100 (default 25)."},"required":false,"description":"Items per page, 1–100 (default 25).","name":"limit","in":"query"}],"responses":{"200":{"description":"One page of sale notes.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"sentAt":{"type":"string","nullable":true,"format":"date-time","description":"When the issued version was sent through Kellu; null when the business marked it as sent/awaiting payment by hand."},"workOrder":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string","nullable":true},"title":{"type":"string","nullable":true}},"required":["id","number","title"]},"status":{"type":"string","enum":["DRAFT","NOT_REQUIRED","AWAITING_PAYMENT","OVERDUE","PAID","CLOSED_UNPAID","BAD_DEBT"],"description":"Collection status of the sale note (OVERDUE derived at read time; CLOSED_UNPAID = closed without registering a payment, never counted as PAID). DRAFT means the document is being revised after having been issued; amounts are those of the last issued version. Documents never issued are not returned (issued = sent through Kellu or marked as sent/awaiting payment by the business)."},"client":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"currency":{"type":"string","enum":["CLP","UF"],"description":"Currency of every amount of the document."},"total":{"type":"number"},"ufValue":{"type":"number","nullable":true,"description":"CLP value of 1 UF frozen when the document was emitted; null in CLP."},"dueAt":{"type":"string","nullable":true,"format":"date-time"},"balanceClp":{"type":"number","description":"Outstanding balance, ALWAYS in CLP (UF totals convert at `ufValue`)."}},"required":["id","number","createdAt","updatedAt","sentAt","workOrder","status","client","currency","total","ufValue","dueAt","balanceClp"]}},"pagination":{"type":"object","properties":{"nextCursor":{"type":"string","nullable":true,"description":"Pass it as `cursor` to read the next page; null = this is the last page."},"hasMore":{"type":"boolean","description":"true ⇔ `nextCursor` is not null."}},"required":["nextCursor","hasMore"]}},"required":["data","pagination"]}}}},"400":{"description":"validation_failed: the request is invalid (details carries the issues; an unknown query parameter is rejected too). A transport-level rejection (405, 413, 415…) also answers validation_failed, with that status. invalid_cursor (lists): the cursor is unreadable or was issued for other parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"invalid_api_key: the API key is missing, invalid, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"api_access_disabled, or insufficient_scope (details.requiredScope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sale-notes/{saleNoteId}":{"get":{"operationId":"get_sale_note","tags":["Sale notes"],"summary":"Get a sale note with its amounts, lines and balance","description":"One emitted sale note. Only ISSUED documents exist here (issued = sent through Kellu or marked as sent/awaiting payment by the business): a document never issued is not listed and answers 404 by id. The amounts and lines are those of the issued version (the approved one, else the last one issued); only billable lines are included. Amounts are in `currency`; `amountPaidClp` and `balanceClp` are always CLP (a UF total converts at `ufValue`). The client email/phone are null unless the key also has `clients:read`. Requires `sale_notes:read`.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"saleNoteId","in":"path"}],"responses":{"200":{"description":"The sale note.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"sentAt":{"type":"string","nullable":true,"format":"date-time","description":"When the issued version was sent through Kellu; null when the business marked it as sent/awaiting payment by hand."},"workOrder":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string","nullable":true},"title":{"type":"string","nullable":true}},"required":["id","number","title"]},"status":{"type":"string","enum":["DRAFT","NOT_REQUIRED","AWAITING_PAYMENT","OVERDUE","PAID","CLOSED_UNPAID","BAD_DEBT"],"description":"Collection status of the sale note (OVERDUE derived at read time; CLOSED_UNPAID = closed without registering a payment, never counted as PAID). DRAFT means the document is being revised after having been issued; amounts are those of the last issued version. Documents never issued are not returned (issued = sent through Kellu or marked as sent/awaiting payment by the business)."},"client":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","nullable":true,"description":"Always null unless the key also has `clients:read`."},"phone":{"type":"string","nullable":true,"description":"Always null unless the key also has `clients:read`."}},"required":["id","name","email","phone"]},"dueAt":{"type":"string","nullable":true,"format":"date-time"},"balanceClp":{"type":"number","description":"Outstanding balance, ALWAYS in CLP (UF totals convert at `ufValue`)."},"amountPaidClp":{"type":"number","description":"Sum of payments, ALWAYS in CLP."},"currency":{"type":"string","enum":["CLP","UF"],"description":"Currency of every amount of the document."},"total":{"type":"number"},"ufValue":{"type":"number","nullable":true,"description":"CLP value of 1 UF frozen when the document was emitted; null in CLP."},"pricesIncludeIva":{"type":"boolean","description":"true = line prices include IVA (gross)."},"subtotal":{"type":"number","nullable":true},"discount":{"type":"number","nullable":true},"discountType":{"type":"string","nullable":true,"enum":["PERCENTAGE","AMOUNT"]},"tax":{"type":"number","nullable":true},"taxPercent":{"type":"number","nullable":true},"chargedExpensesTotal":{"type":"number","description":"Expenses charged to the client, included in total (in `currency`)."},"lineItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"itemType":{"type":"string","enum":["SERVICE","PRODUCT"]},"description":{"type":"string","nullable":true},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"price":{"type":"number","description":"Unit price in `currency`."},"groupName":{"type":"string","nullable":true}},"required":["id","name","itemType","description","quantity","unit","price","groupName"]}}},"required":["id","number","createdAt","updatedAt","sentAt","workOrder","status","client","dueAt","balanceClp","amountPaidClp","currency","total","ufValue","pricesIncludeIva","subtotal","discount","discountType","tax","taxPercent","chargedExpensesTotal","lineItems"]}},"required":["data"]}}}},"401":{"description":"invalid_api_key: the API key is missing, invalid, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"api_access_disabled, or insufficient_scope (details.requiredScope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: the resource does not exist for this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/assets":{"get":{"operationId":"list_assets","tags":["Equipment"],"summary":"List equipment","description":"Equipment (assets) of the business, newest first by default. Ordered by `sortBy` in `order`, ties broken by `id` in the same direction; pages follow `pagination.nextCursor`. `search` matches name, serial number and specs. Requires `assets:read`.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"clientId","in":"query"},{"schema":{"type":"string","enum":["ACTIVE","RETIRED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["OPERATIONAL","NEEDS_ATTENTION","OUT_OF_SERVICE","PENDING_REVIEW"]},"required":false,"name":"healthStatus","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["createdAt","updatedAt"],"default":"createdAt"},"required":false,"name":"sortBy","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"order","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2026-01-31T12:00:00Z","description":"Only rows whose `updatedAt` is at or after this instant (ISO 8601 date-time with zone, `Z` or `±hh:mm`; URL-encode the `+` as `%2B`). For incremental sync use `sortBy=updatedAt&order=asc&updatedSince=<last updatedAt seen>` and re-read with an overlap window (upsert by id): `updatedAt` is stamped before the change commits. Not reported, use the webhooks for them: deletions; a change in a child record that does not touch the parent `updatedAt`; derived values that change without touching the row — a sale note `status`, `amountPaidClp` and `balanceClp` (payments), a work order `saleNoteStatus`."},"required":false,"description":"Only rows whose `updatedAt` is at or after this instant (ISO 8601 date-time with zone, `Z` or `±hh:mm`; URL-encode the `+` as `%2B`). For incremental sync use `sortBy=updatedAt&order=asc&updatedSince=<last updatedAt seen>` and re-read with an overlap window (upsert by id): `updatedAt` is stamped before the change commits. Not reported, use the webhooks for them: deletions; a change in a child record that does not touch the parent `updatedAt`; derived values that change without touching the row — a sale note `status`, `amountPaidClp` and `balanceClp` (payments), a work order `saleNoteStatus`.","name":"updatedSince","in":"query"},{"schema":{"type":"string","description":"Opaque cursor: the `pagination.nextCursor` of the previous page; omit it for the first page. Send it with the SAME other parameters (filters, `sortBy`, `order`) as the request that returned it, or the API answers 400 `invalid_cursor`. `limit` may change between pages."},"required":false,"description":"Opaque cursor: the `pagination.nextCursor` of the previous page; omit it for the first page. Send it with the SAME other parameters (filters, `sortBy`, `order`) as the request that returned it, or the API answers 400 `invalid_cursor`. `limit` may change between pages.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Items per page, 1–100 (default 25)."},"required":false,"description":"Items per page, 1–100 (default 25).","name":"limit","in":"query"}],"responses":{"200":{"description":"One page of equipment.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"serialNumber":{"type":"string","nullable":true},"status":{"type":"string","enum":["ACTIVE","RETIRED"]},"healthStatus":{"type":"string","enum":["OPERATIONAL","NEEDS_ATTENTION","OUT_OF_SERVICE","PENDING_REVIEW"]},"installDate":{"type":"string","nullable":true,"format":"date","description":"YYYY-MM-DD."},"client":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"location":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"formattedAddress":{"type":"string"}},"required":["id","name","formattedAddress"]},"catalogItem":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Catalog product this equipment is an instance of."},"attributes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name","value"]},"description":"Specs: the catalog product ones first, then the equipment own ones."},"openWorkOrderCount":{"type":"integer"},"nextVisitAt":{"type":"string","nullable":true,"format":"date-time"},"lastServiceAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","serialNumber","status","healthStatus","installDate","client","location","catalogItem","attributes","openWorkOrderCount","nextVisitAt","lastServiceAt","createdAt","updatedAt"]}},"pagination":{"type":"object","properties":{"nextCursor":{"type":"string","nullable":true,"description":"Pass it as `cursor` to read the next page; null = this is the last page."},"hasMore":{"type":"boolean","description":"true ⇔ `nextCursor` is not null."}},"required":["nextCursor","hasMore"]}},"required":["data","pagination"]}}}},"400":{"description":"validation_failed: the request is invalid (details carries the issues; an unknown query parameter is rejected too). A transport-level rejection (405, 413, 415…) also answers validation_failed, with that status. invalid_cursor (lists): the cursor is unreadable or was issued for other parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"invalid_api_key: the API key is missing, invalid, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"api_access_disabled, or insufficient_scope (details.requiredScope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/assets/{assetId}":{"get":{"operationId":"get_asset","tags":["Equipment"],"summary":"Get one piece of equipment","description":"One piece of equipment with its address, catalog product, specs and maintenance rollup (open work orders, next visit, last service). Requires `assets:read`.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"assetId","in":"path"}],"responses":{"200":{"description":"The equipment.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"serialNumber":{"type":"string","nullable":true},"status":{"type":"string","enum":["ACTIVE","RETIRED"]},"healthStatus":{"type":"string","enum":["OPERATIONAL","NEEDS_ATTENTION","OUT_OF_SERVICE","PENDING_REVIEW"]},"installDate":{"type":"string","nullable":true,"format":"date","description":"YYYY-MM-DD."},"client":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"location":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"formattedAddress":{"type":"string"}},"required":["id","name","formattedAddress"]},"catalogItem":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Catalog product this equipment is an instance of."},"attributes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name","value"]},"description":"Specs: the catalog product ones first, then the equipment own ones."},"openWorkOrderCount":{"type":"integer"},"nextVisitAt":{"type":"string","nullable":true,"format":"date-time"},"lastServiceAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","serialNumber","status","healthStatus","installDate","client","location","catalogItem","attributes","openWorkOrderCount","nextVisitAt","lastServiceAt","createdAt","updatedAt"]}},"required":["data"]}}}},"401":{"description":"invalid_api_key: the API key is missing, invalid, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"api_access_disabled, or insufficient_scope (details.requiredScope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: the resource does not exist for this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/assets/{assetId}/history":{"get":{"operationId":"get_asset_history","tags":["Equipment"],"summary":"Get the service history of one piece of equipment","description":"Work orders linked to the equipment, newest work order first (ties broken by work order id, descending), each with its submitted job forms; pages follow `pagination.nextCursor`. Requires `assets:read`.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"assetId","in":"path"},{"schema":{"type":"string","description":"Opaque cursor: the `pagination.nextCursor` of the previous page; omit it for the first page. Send it with the SAME other parameters (filters, `sortBy`, `order`) as the request that returned it, or the API answers 400 `invalid_cursor`. `limit` may change between pages."},"required":false,"description":"Opaque cursor: the `pagination.nextCursor` of the previous page; omit it for the first page. Send it with the SAME other parameters (filters, `sortBy`, `order`) as the request that returned it, or the API answers 400 `invalid_cursor`. `limit` may change between pages.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Items per page, 1–100 (default 25)."},"required":false,"description":"Items per page, 1–100 (default 25).","name":"limit","in":"query"}],"responses":{"200":{"description":"One page of history.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"linkedAt":{"type":"string","format":"date-time"},"workOrder":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"jobStatus":{"type":"string","enum":["UNSCHEDULED","UNASSIGNED","SCHEDULED","ON_MY_WAY","IN_PROGRESS","COMPLETED","NOT_REQUIRED"],"description":"Stored job status of the work order."},"scheduledAt":{"type":"string","nullable":true,"format":"date-time"},"completedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","number","title","jobStatus","scheduledAt","completedAt"]},"jobForms":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"submittedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","name","submittedAt"]}}},"required":["linkedAt","workOrder","jobForms"]}},"pagination":{"type":"object","properties":{"nextCursor":{"type":"string","nullable":true,"description":"Pass it as `cursor` to read the next page; null = this is the last page."},"hasMore":{"type":"boolean","description":"true ⇔ `nextCursor` is not null."}},"required":["nextCursor","hasMore"]}},"required":["data","pagination"]}}}},"400":{"description":"validation_failed: the request is invalid (details carries the issues; an unknown query parameter is rejected too). A transport-level rejection (405, 413, 415…) also answers validation_failed, with that status. invalid_cursor (lists): the cursor is unreadable or was issued for other parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"invalid_api_key: the API key is missing, invalid, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"api_access_disabled, or insufficient_scope (details.requiredScope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: the resource does not exist for this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/catalog-items":{"get":{"operationId":"list_catalog_items","tags":["Catalog"],"summary":"List catalog items (services and products)","description":"Every item of the business catalog (billable and internal ones, see `billable`), ordered by creation date, oldest first, by default. Ordered by `sortBy` in `order`, ties broken by `id` ascending; pages follow `pagination.nextCursor`. Prices are the base sale prices (per-client prices are not exposed). `search` matches name, description, SKU and tag names. Requires `catalog:read`.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","maxLength":200},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["SERVICE","PRODUCT"]},"required":false,"name":"itemType","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Only bundles / none."},"required":false,"description":"Only bundles / none.","name":"isBundle","in":"query"},{"schema":{"type":"string","enum":["createdAt","updatedAt"],"default":"createdAt"},"required":false,"name":"sortBy","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"asc"},"required":false,"name":"order","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2026-01-31T12:00:00Z","description":"Only rows whose `updatedAt` is at or after this instant (ISO 8601 date-time with zone, `Z` or `±hh:mm`; URL-encode the `+` as `%2B`). For incremental sync use `sortBy=updatedAt&order=asc&updatedSince=<last updatedAt seen>` and re-read with an overlap window (upsert by id): `updatedAt` is stamped before the change commits. Not reported, use the webhooks for them: deletions; a change in a child record that does not touch the parent `updatedAt`; derived values that change without touching the row — a sale note `status`, `amountPaidClp` and `balanceClp` (payments), a work order `saleNoteStatus`."},"required":false,"description":"Only rows whose `updatedAt` is at or after this instant (ISO 8601 date-time with zone, `Z` or `±hh:mm`; URL-encode the `+` as `%2B`). For incremental sync use `sortBy=updatedAt&order=asc&updatedSince=<last updatedAt seen>` and re-read with an overlap window (upsert by id): `updatedAt` is stamped before the change commits. Not reported, use the webhooks for them: deletions; a change in a child record that does not touch the parent `updatedAt`; derived values that change without touching the row — a sale note `status`, `amountPaidClp` and `balanceClp` (payments), a work order `saleNoteStatus`.","name":"updatedSince","in":"query"},{"schema":{"type":"string","description":"Opaque cursor: the `pagination.nextCursor` of the previous page; omit it for the first page. Send it with the SAME other parameters (filters, `sortBy`, `order`) as the request that returned it, or the API answers 400 `invalid_cursor`. `limit` may change between pages."},"required":false,"description":"Opaque cursor: the `pagination.nextCursor` of the previous page; omit it for the first page. Send it with the SAME other parameters (filters, `sortBy`, `order`) as the request that returned it, or the API answers 400 `invalid_cursor`. `limit` may change between pages.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Items per page, 1–100 (default 25)."},"required":false,"description":"Items per page, 1–100 (default 25).","name":"limit","in":"query"}],"responses":{"200":{"description":"One page of catalog items.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"itemType":{"type":"string","enum":["SERVICE","PRODUCT"]},"name":{"type":"string"},"description":{"type":"string","nullable":true},"sku":{"type":"string","nullable":true},"unit":{"type":"string","nullable":true},"price":{"type":"number","nullable":true,"description":"Sale price in CLP; null = none set. List price as stored; whether tax is included is defined per quote / sale note (see pricesIncludeIva there)."},"priceUf":{"type":"number","nullable":true,"description":"Sale price in UF; null = none set. List price as stored; whether tax is included is defined per quote / sale note (see pricesIncludeIva there)."},"billable":{"type":"boolean","description":"false = internal item (consumable): it is never charged to the client."},"isBundle":{"type":"boolean"},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","itemType","name","description","sku","unit","price","priceUf","billable","isBundle","tags","createdAt","updatedAt"]}},"pagination":{"type":"object","properties":{"nextCursor":{"type":"string","nullable":true,"description":"Pass it as `cursor` to read the next page; null = this is the last page."},"hasMore":{"type":"boolean","description":"true ⇔ `nextCursor` is not null."}},"required":["nextCursor","hasMore"]}},"required":["data","pagination"]}}}},"400":{"description":"validation_failed: the request is invalid (details carries the issues; an unknown query parameter is rejected too). A transport-level rejection (405, 413, 415…) also answers validation_failed, with that status. invalid_cursor (lists): the cursor is unreadable or was issued for other parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"invalid_api_key: the API key is missing, invalid, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"api_access_disabled, or insufficient_scope (details.requiredScope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/catalog-items/{itemId}":{"get":{"operationId":"get_catalog_item","tags":["Catalog"],"summary":"Get a catalog item, with the components of a bundle","description":"One catalog item; a bundle lists its components (`catalogItemId`, name, quantity, unit). Requires `catalog:read`.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"itemId","in":"path"}],"responses":{"200":{"description":"The catalog item.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"itemType":{"type":"string","enum":["SERVICE","PRODUCT"]},"name":{"type":"string"},"description":{"type":"string","nullable":true},"sku":{"type":"string","nullable":true},"unit":{"type":"string","nullable":true},"price":{"type":"number","nullable":true,"description":"Sale price in CLP; null = none set. List price as stored; whether tax is included is defined per quote / sale note (see pricesIncludeIva there)."},"priceUf":{"type":"number","nullable":true,"description":"Sale price in UF; null = none set. List price as stored; whether tax is included is defined per quote / sale note (see pricesIncludeIva there)."},"billable":{"type":"boolean","description":"false = internal item (consumable): it is never charged to the client."},"isBundle":{"type":"boolean"},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"components":{"type":"array","items":{"type":"object","properties":{"catalogItemId":{"type":"string"},"name":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true}},"required":["catalogItemId","name","quantity","unit"]},"description":"Items a bundle is made of (empty when not a bundle)."}},"required":["id","itemType","name","description","sku","unit","price","priceUf","billable","isBundle","tags","createdAt","updatedAt","components"]}},"required":["data"]}}}},"401":{"description":"invalid_api_key: the API key is missing, invalid, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"api_access_disabled, or insufficient_scope (details.requiredScope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: the resource does not exist for this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/team-members":{"get":{"operationId":"list_team_members","tags":["Team"],"summary":"List the team: active members and the owner","description":"Active members of the business plus its owner (`isOwner`), with their role. The owner has no member id: its entry has `id: \"owner\"` (unless the owner is also a member). Inactive members are not listed. `canBeAssigned`: only members with true can receive new work (technicians / assignees); the `owner` entry is always false. Requires `team:read`.","security":[{"apiKey":[]}],"responses":{"200":{"description":"The team.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Member id (the `memberId` of assignees). The business owner has no member id: its entry is `owner`."},"name":{"type":"string"},"email":{"type":"string"},"title":{"type":"string","nullable":true,"description":"Customer-facing title, e.g. \"Engineer\"."},"role":{"type":"object","properties":{"key":{"type":"string","nullable":true,"description":"OWNER, ADMIN, SCHEDULER, SALES, TECHNICIAN; null = custom (legacy) role."},"name":{"type":"string"}},"required":["key","name"]},"isOwner":{"type":"boolean"},"canBeAssigned":{"type":"boolean","description":"Whether new work can be assigned to this member (technicianIds / assignees). Always false for the `owner` entry (no member id)."}},"required":["id","name","email","title","role","isOwner","canBeAssigned"]}}},"required":["data"]}}}},"400":{"description":"validation_failed: the request is invalid (details carries the issues; an unknown query parameter is rejected too). A transport-level rejection (405, 413, 415…) also answers validation_failed, with that status. invalid_cursor (lists): the cursor is unreadable or was issued for other parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"invalid_api_key: the API key is missing, invalid, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"api_access_disabled, or insufficient_scope (details.requiredScope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tickets":{"get":{"operationId":"list_business_tickets","tags":["Tickets"],"summary":"List tickets","description":"Tickets (problem reports) of the business, newest first by default, postponed ones included. Ordered by `sortBy` in `order`, ties broken by `id` in the same direction; pages follow `pagination.nextCursor`. Without the thread: use the ticket detail for its messages. Only when the business has Tickets enabled (otherwise 404). Every ticket of the business: an API key is a business credential, so internal notes are included in the thread (`internal: true`, never shown to the client). Requires `tickets:read`.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","enum":["OPEN","IN_REVIEW","CONVERTED_TO_WORK_ORDER","RESOLVED","DISMISSED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"required":false,"name":"severity","in":"query"},{"schema":{"type":"string"},"required":false,"name":"clientId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assetId","in":"query"},{"schema":{"type":"string","enum":["createdAt","updatedAt"],"default":"createdAt"},"required":false,"name":"sortBy","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"order","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2026-01-31T12:00:00Z","description":"Only rows whose `updatedAt` is at or after this instant (ISO 8601 date-time with zone, `Z` or `±hh:mm`; URL-encode the `+` as `%2B`). For incremental sync use `sortBy=updatedAt&order=asc&updatedSince=<last updatedAt seen>` and re-read with an overlap window (upsert by id): `updatedAt` is stamped before the change commits. Not reported, use the webhooks for them: deletions; a change in a child record that does not touch the parent `updatedAt`; derived values that change without touching the row — a sale note `status`, `amountPaidClp` and `balanceClp` (payments), a work order `saleNoteStatus`."},"required":false,"description":"Only rows whose `updatedAt` is at or after this instant (ISO 8601 date-time with zone, `Z` or `±hh:mm`; URL-encode the `+` as `%2B`). For incremental sync use `sortBy=updatedAt&order=asc&updatedSince=<last updatedAt seen>` and re-read with an overlap window (upsert by id): `updatedAt` is stamped before the change commits. Not reported, use the webhooks for them: deletions; a change in a child record that does not touch the parent `updatedAt`; derived values that change without touching the row — a sale note `status`, `amountPaidClp` and `balanceClp` (payments), a work order `saleNoteStatus`.","name":"updatedSince","in":"query"},{"schema":{"type":"string","description":"Opaque cursor: the `pagination.nextCursor` of the previous page; omit it for the first page. Send it with the SAME other parameters (filters, `sortBy`, `order`) as the request that returned it, or the API answers 400 `invalid_cursor`. `limit` may change between pages."},"required":false,"description":"Opaque cursor: the `pagination.nextCursor` of the previous page; omit it for the first page. Send it with the SAME other parameters (filters, `sortBy`, `order`) as the request that returned it, or the API answers 400 `invalid_cursor`. `limit` may change between pages.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Items per page, 1–100 (default 25)."},"required":false,"description":"Items per page, 1–100 (default 25).","name":"limit","in":"query"}],"responses":{"200":{"description":"One page of tickets.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"integer","nullable":true,"description":"Ticket number shown to the business and the client («#12»), counted per business."},"status":{"type":"string","enum":["OPEN","IN_REVIEW","CONVERTED_TO_WORK_ORDER","RESOLVED","DISMISSED"],"description":"CONVERTED_TO_WORK_ORDER is final (see `workOrderId`). RESOLVED and DISMISSED are closed."},"severity":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"description":{"type":"string"},"origin":{"type":"string","enum":["STAFF","PORTAL"],"description":"STAFF = created by the business; PORTAL = reported by the client in the client portal."},"client":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"null = ticket without a client yet."},"asset":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Equipment the ticket is about, if any."},"assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string","nullable":true,"description":"Team member id as in `list_team_members` (`owner` for a business owner without a member entry); null when it cannot be matched to a team member."},"name":{"type":"string"}},"required":["id","name"],"description":"The person responsible for the ticket. null = unassigned, or ticket assignment is turned off in the business."},"dueAt":{"type":"string","nullable":true,"format":"date-time"},"snoozedUntil":{"type":"string","nullable":true,"format":"date-time","description":"Postponed until this instant (hidden from the default views in the web app while in the future). Not a status."},"isOverdue":{"type":"boolean","description":"true when `dueAt` is past and the ticket is still OPEN or IN_REVIEW."},"originWorkOrderId":{"type":"string","nullable":true,"description":"Work order the ticket was reported from."},"workOrderId":{"type":"string","nullable":true,"description":"Work order the ticket was converted into (status CONVERTED_TO_WORK_ORDER)."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"resolvedAt":{"type":"string","nullable":true,"format":"date-time","description":"When it reached a final status (converted, resolved or dismissed)."}},"required":["id","number","status","severity","description","origin","client","asset","assignee","dueAt","snoozedUntil","isOverdue","originWorkOrderId","workOrderId","createdAt","updatedAt","resolvedAt"]}},"pagination":{"type":"object","properties":{"nextCursor":{"type":"string","nullable":true,"description":"Pass it as `cursor` to read the next page; null = this is the last page."},"hasMore":{"type":"boolean","description":"true ⇔ `nextCursor` is not null."}},"required":["nextCursor","hasMore"]}},"required":["data","pagination"]}}}},"400":{"description":"validation_failed: the request is invalid (details carries the issues; an unknown query parameter is rejected too). A transport-level rejection (405, 413, 415…) also answers validation_failed, with that status. invalid_cursor (lists): the cursor is unreadable or was issued for other parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"invalid_api_key: the API key is missing, invalid, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"api_access_disabled, or insufficient_scope (details.requiredScope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: the resource does not exist for this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tickets/{ticketId}":{"get":{"operationId":"get_business_ticket","tags":["Tickets"],"summary":"Get one ticket with its messages","description":"One ticket with its message thread, oldest first. Only when the business has Tickets enabled (otherwise 404). Every ticket of the business: an API key is a business credential, so internal notes are included in the thread (`internal: true`, never shown to the client). Requires `tickets:read`.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"ticketId","in":"path"}],"responses":{"200":{"description":"The ticket.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"integer","nullable":true,"description":"Ticket number shown to the business and the client («#12»), counted per business."},"status":{"type":"string","enum":["OPEN","IN_REVIEW","CONVERTED_TO_WORK_ORDER","RESOLVED","DISMISSED"],"description":"CONVERTED_TO_WORK_ORDER is final (see `workOrderId`). RESOLVED and DISMISSED are closed."},"severity":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"description":{"type":"string"},"origin":{"type":"string","enum":["STAFF","PORTAL"],"description":"STAFF = created by the business; PORTAL = reported by the client in the client portal."},"client":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"null = ticket without a client yet."},"asset":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Equipment the ticket is about, if any."},"assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string","nullable":true,"description":"Team member id as in `list_team_members` (`owner` for a business owner without a member entry); null when it cannot be matched to a team member."},"name":{"type":"string"}},"required":["id","name"],"description":"The person responsible for the ticket. null = unassigned, or ticket assignment is turned off in the business."},"dueAt":{"type":"string","nullable":true,"format":"date-time"},"snoozedUntil":{"type":"string","nullable":true,"format":"date-time","description":"Postponed until this instant (hidden from the default views in the web app while in the future). Not a status."},"isOverdue":{"type":"boolean","description":"true when `dueAt` is past and the ticket is still OPEN or IN_REVIEW."},"originWorkOrderId":{"type":"string","nullable":true,"description":"Work order the ticket was reported from."},"workOrderId":{"type":"string","nullable":true,"description":"Work order the ticket was converted into (status CONVERTED_TO_WORK_ORDER)."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"resolvedAt":{"type":"string","nullable":true,"format":"date-time","description":"When it reached a final status (converted, resolved or dismissed)."},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"authorType":{"type":"string","enum":["STAFF","PORTAL"],"description":"STAFF = the business; PORTAL = the client in the client portal."},"authorName":{"type":"string"},"internal":{"type":"boolean","description":"Internal note: business staff only, never shown nor emailed to the client."},"createdAt":{"type":"string","format":"date-time"}},"required":["id","text","authorType","authorName","internal","createdAt"]},"description":"Thread, oldest first."}},"required":["id","number","status","severity","description","origin","client","asset","assignee","dueAt","snoozedUntil","isOverdue","originWorkOrderId","workOrderId","createdAt","updatedAt","resolvedAt","messages"]}},"required":["data"]}}}},"401":{"description":"invalid_api_key: the API key is missing, invalid, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"api_access_disabled, or insufficient_scope (details.requiredScope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: the resource does not exist for this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}