{"openapi":"3.0.3","info":{"title":"IWANA API","version":"1.0.0","description":"The IWANA API lets your systems read and write the same records the dashboard shows:\nrendez-vous, contacts and companies, sites, equipment, the catalogue, the team, quotes,\ninvoices, intervention reports, chantiers, tasks, workflows and the workspace configuration.\nEvery operation listed here can be called with an API key; nothing else is listed.\n\n**Authentication.** Every call carries an API key as a bearer token. Create one in\nRéglages → Développeurs. The key embeds its workspace, so there is no workspace\nheader to send and a key can never be pointed at a workspace it does not belong to.\nA test key (`iw_test_…`) works in the workspace's **sandbox**: a separate workspace of its\nown that it reads and writes freely. Nothing it does reaches the real workspace; no e-mail,\nSMS or push ever leaves a sandbox, and third-party integrations are off there. Every\nresponse to a key or a token carries `Iwana-Livemode: true` or `false`, and so does the\nerror envelope (`error.livemode`). Keys and OAuth tokens cannot invoke the AI features\n(AI drafting of workflows, PDF extraction): those stay in the app.\n\n```bash\ncurl -H \"Authorization: Bearer iw_live_...\" \\\\\n  https://iwana.fr/v3/api/v1/pro/clients?limit=5\n```\n\n**Lists.** Lists do not all share one shape — each operation's 200 response says which it\nis: a page `{ items, total }` (some also echo `limit` and `offset`) with its own default\nand maximum page size, `{ items }`, or a bare array. `total` counts the whole match, not\nthe page. A `limit` above the maximum is lowered to it on most lists; the few that refuse\nit with a 400 say so on the parameter.\n\n**Validation.** Request bodies (and query strings with a declared parameter list) are strict:\na field the schema does not declare is refused with `400 validation_failed`, it is not\nsilently dropped; so is a number that is not one (`limit=abc`). Responses are the other way\nround — fields are added without notice, so ignore the ones you do not know and never fail\non them. Order of checks: the credential, then permissions, then the body.\n\n**Rate limits.** Every API key and OAuth token of a workspace spends one budget:\n`X-RateLimit-Limit` / `-Remaining` / `-Reset` (seconds) describe the minute window and the\nsame names with `-Day` the day window; past either, `429 rate_limited` with `Retry-After`.\nA per-IP floor runs before authentication, under the same unsuffixed names. A call refused\nby the credential and permission checks (`401`, a `403`, a\n`402 erp_required` on a chantier) carries only those per-IP headers — no `-Day` ones — and\ndoes not spend the workspace budget. A sandbox has a budget of its own, separate from the\nlive one and smaller (120 per minute and 5 000 per day by default).\n\n**Retries.** Send `Idempotency-Key: <8–128 chars>` on these creates: `/appointments`, `/clients`, `/companies`, `/contacts`, `/contracts`, `/equipments`, `/interventions`, `/invoices`, `/invoices/{id}/credit-note`, `/invoices/{id}/payments`, `/invoices/from-contract/{contractId}`, `/invoices/from-intervention/{reportId}`, `/invoices/from-quote/{quoteId}`, `/projects`, `/projects/{id}/duplicate`, `/quotes`, `/quotes/{id}/duplicate`, `/quotes/dpgf`, `/sites`, `/tasks`.\nA retry with the same key on the same route within 48 h returns the first response\ninstead of creating a second record; a key outside 8–128 characters is a\n`400 invalid_idempotency_key`. Other routes ignore the header.\n\n**Your ids.** `POST /pro/clients` creates a contact unless the body carries its IWANA `id`:\nit never matches an existing contact by email or phone. To avoid duplicates, record\nthe mapping between your ids and IWANA's with `PUT /pro/external-refs` and look it up\nwith `GET /pro/external-refs` (which answers `{ \"item\": null }` on a miss) before creating.\n\n**Source.** A rendez-vous written with a key or a token is stamped `source: API` unless\nthe body sends its own `source`.\n\n**Webhooks.** Subscribe a public HTTPS URL in Réglages → Développeurs; a redirect is not followed. Each event is a signed\n`POST` of `{ event, orgId, data: { id, … }, occurredAt, livemode }`; `x-iwana-webhook-events`\nlists the event types and `webhooks.event` describes the delivery. `data` is small on\npurpose — ids, status, ISO dates, amounts in cents — so re-read the record with `GET`\nwhen you need all of it.\n\n**Compatibility.** Removing a field or changing its type means a new major version in\nthe path.","contact":{"name":"IWANA","url":"https://iwana.fr/v3"}},"servers":[{"url":"https://iwana.fr/v3/api/v1","description":"Production"}],"tags":[{"name":"Intégration","description":"Check a key: which workspace it opens and what it may do."},{"name":"Bac à sable","description":"The sandbox a test key (`iw_test_…`) works in. It starts with demo data — 3 staff, 6 services, 25 clients, 40 appointments over the 30 days before and after, a few quotes and invoices in every state — written in the language of the workspace. The demo ids are derived from the workspace and never change: a reset gives the same ones back, so a test can hard-code them."},{"name":"Rendez-vous","description":"The appointments themselves (and the blocked slots, `type=UNAVAILABILITY`) — create, reschedule, change status, cancel; plus the calendar and map read models and the technician's \"on my way\" sharing."},{"name":"Disponibilités","description":"Working hours (plannings per member), week templates, closure days and bank holidays. `GET /availability/resolve` gives the effective working windows per member and day — not free booking slots: existing appointments are not subtracted."},{"name":"Contacts","description":"The address book. `/clients` holds people (`kind=INDIVIDUAL`) and companies (`kind=COMPANY`) — a list without `kind` returns people only. `/companies` is the company view of the same records, `/contacts` the people attached to an account, `/companies/lists` the imported or hosted lists."},{"name":"IDs externes","description":"The mapping between your ids and IWANA's — how an integration avoids creating the same contact twice."},{"name":"Sites","description":"The addresses work happens at. A site belongs to a contact or a company and carries the access notes, GPS position and on-site people."},{"name":"Équipements","description":"What is installed at a site (boilers, heat pumps…). ERP modules."},{"name":"Contrats","description":"Maintenance contracts: lines, covered equipment and their cadence. ERP modules."},{"name":"Catalogue","description":"Bookable services (prestations) with their variants and categories, locations, promotions, questionnaires, who can perform what, contract templates and the shared service library. Not the quoting price library, which is `/catalogue` (tag Bibliothèque de prix). A service `price` is in euros — returned as a decimal string, sent as a number; everything named `…Cents` is integer cents."},{"name":"Équipe","description":"Members of the workspace (colleagues, NOT contacts), their roles and permissions, and teams."},{"name":"Chantiers","description":"Projects (chantiers): structure, phases, rooms, tasks, reserves, measurements, documents, parties and partner companies."},{"name":"Tâches","description":"To-dos, optionally attached to a record."},{"name":"Configuration","description":"Business rules (booking delays, cancellation…) and custom field definitions."},{"name":"Workflows","description":"Automations: definitions, test runs and the runs waiting for approval. Drafting a workflow with AI is not available to keys."},{"name":"Communications","description":"Messages sent to customers: history, templates, notification settings and sender identity."},{"name":"Statistiques","description":"Dashboard tiles and KPIs, and the workspace activity feed."},{"name":"Géo","description":"Address autocomplete, geocoding and the French regions."}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key minted in Réglages → Développeurs, sent as `Authorization: Bearer iw_live_…`. The secret is shown once at creation and stored only as a hash — if it is lost, revoke it and mint another. Revocation takes effect on the next request. An OAuth access token (`iwa_at_…`) is accepted the same way."}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128},"description":"Any string you generate per logical create (a UUID works). The same key on the same route within 48 h replays the first successful response instead of creating again; an error is not stored, so retry it with the same key."}},"responses":{"BadRequest":{"description":"Validation failed (`validation_failed`, which includes a field the schema does not declare) or a business rule refused the call (a specific code such as `client_not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"validation_failed","message":"Validation failed","requestId":"5f0c2a9e-3b7d-4e61-9a24-8c1f0e6d7b52"}}}}},"Unauthenticated":{"description":"Missing, malformed, or revoked credential (`unauthenticated`, `invalid_api_key`, `invalid_token`), or a key sent to the wrong address: a test key outside the sandbox (`test_key_requires_sandbox`), anything but a test key inside it (`sandbox_requires_test_key`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_api_key","message":"Invalid api key","requestId":"5f0c2a9e-3b7d-4e61-9a24-8c1f0e6d7b52"}}}}},"Forbidden":{"description":"Refused: a role that may not do it (OAuth token), an action keys cannot take (`scope_required`), something a sandbox does not do (`not_available_in_sandbox`), or an offer switched off for the whole platform (`offer_disabled`, e.g. ERP).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"scope_required","message":"Scope required","requestId":"5f0c2a9e-3b7d-4e61-9a24-8c1f0e6d7b52"}}}}},"NotFound":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Not found","requestId":"5f0c2a9e-3b7d-4e61-9a24-8c1f0e6d7b52"}}}}},"RateLimited":{"description":"The workspace's budget is spent (`rate_limited`); wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Rate limited","requestId":"5f0c2a9e-3b7d-4e61-9a24-8c1f0e6d7b52"}}}}},"ErpRequired":{"description":"The workspace's plan does not include the ERP modules (`erp_required`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"erp_required","message":"Erp required","requestId":"5f0c2a9e-3b7d-4e61-9a24-8c1f0e6d7b52"}}}}}},"schemas":{"Error":{"type":"object","description":"Every failure has this shape.","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"invalid_api_key","description":"Stable, machine-readable."},"message":{"type":"string","description":"Human-readable; may change."},"requestId":{"type":"string","description":"Quote this when asking us about a call. Also sent as `X-Request-Id` on every response."},"livemode":{"type":"boolean","description":"`false` when the call ran in a sandbox (a test key), `true` otherwise. Absent when the caller could not be identified."},"details":{"description":"Present when the refusal has structured data to add."}},"required":["code","message"]}},"required":["error"]},"WebhookEvent":{"type":"object","description":"The body of every webhook delivery.","properties":{"event":{"type":"string","enum":["appointment.created","appointment.updated","appointment.cancelled","client.created","client.updated","client.deleted","quote.created","quote.updated","quote.deleted","invoice.created","invoice.updated","invoice.deleted","payment.created","intervention.created","intervention.updated","intervention.deleted","project.created","project.updated","project.deleted"]},"orgId":{"type":"string","description":"The workspace the event happened in."},"data":{"type":"object","description":"Always carries the record `id`; the rest depends on the event and stays small: related ids, `status`, ISO dates, amounts in integer cents. Quote, invoice, payment, intervention and project events carry no names, notes or addresses; `client.created` / `client.updated` carry the contact's `fullName` and `email`. Re-read the record with GET when you need all of it.","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":true},"occurredAt":{"type":"string","format":"date-time"},"livemode":{"type":"boolean","description":"`false` for an event of the sandbox, `true` otherwise."}},"required":["event","orgId","data","occurredAt","livemode"]},"Appointment":{"type":"object","description":"A rendez-vous as `GET /appointments/{id}` returns it: every column plus the joined client, service, location, crew, site, report and history. List items are a smaller projection (`AppointmentListItem`).","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["APPOINTMENT","UNAVAILABILITY"]},"title":{"type":"string","nullable":true},"startAt":{"type":"string","format":"date-time"},"endAt":{"type":"string","format":"date-time"},"timezone":{"type":"string","nullable":true},"status":{"type":"string","enum":["PENDING","AWAITING_CLIENT","CONFIRMED","IN_PROGRESS","COMPLETED","CANCELLED","NO_SHOW","RESCHEDULED","EXPIRED","REQUEST_REJECTED","OFFER_DECLINED"]},"source":{"type":"string","enum":["DASHBOARD","WIDGET","MARKETPLACE","API","AI_ASSISTANT","WORKFLOW","IMPORT","PLUGIN"],"description":"`API` for a record written with a key or a token, unless the call sent its own `source`."},"clientId":{"type":"string","nullable":true},"contactId":{"type":"string","nullable":true},"serviceId":{"type":"string","nullable":true},"locationId":{"type":"string","nullable":true},"siteId":{"type":"string","description":"The registered address this happens at.","nullable":true},"projectId":{"type":"string","nullable":true},"internalNotes":{"type":"string","nullable":true},"clientNotes":{"type":"string","nullable":true},"totalAmountCents":{"type":"integer","nullable":true},"depositAmountCents":{"type":"integer","nullable":true},"currency":{"type":"string","nullable":true},"customFields":{"type":"object","additionalProperties":true},"metadata":{"type":"object","additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"cancelledAt":{"type":"string","format":"date-time","nullable":true},"completedAt":{"type":"string","format":"date-time","nullable":true},"noShowAt":{"type":"string","format":"date-time","nullable":true},"client":{"type":"object","additionalProperties":true,"nullable":true},"service":{"type":"object","additionalProperties":true,"description":"The service row plus `archived` (boolean): an archived service stays on the appointments that name it.","nullable":true},"location":{"type":"object","additionalProperties":true,"nullable":true},"site":{"type":"object","additionalProperties":true,"nullable":true},"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Membership id."},"displayName":{"type":"string","nullable":true},"avatar":{"type":"string","nullable":true},"color":{"type":"string","nullable":true}},"required":["id","displayName","avatar","color"]}},"participants":{"type":"array","items":{"type":"object","additionalProperties":true}},"report":{"type":"object","additionalProperties":true,"description":"`{ id, status, signedAt, validatedAt }` of the intervention report, if any.","nullable":true},"photos":{"type":"array","items":{"type":"object","additionalProperties":true}},"activeContract":{"type":"object","additionalProperties":true,"nullable":true}}},"AppointmentListItem":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["APPOINTMENT","UNAVAILABILITY"]},"title":{"type":"string","nullable":true},"startAt":{"type":"string","format":"date-time"},"endAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["PENDING","AWAITING_CLIENT","CONFIRMED","IN_PROGRESS","COMPLETED","CANCELLED","NO_SHOW","RESCHEDULED","EXPIRED","REQUEST_REJECTED","OFFER_DECLINED"]},"clientId":{"type":"string","nullable":true},"contactId":{"type":"string","nullable":true},"serviceId":{"type":"string","nullable":true},"locationId":{"type":"string","nullable":true},"siteId":{"type":"string","nullable":true},"source":{"type":"string"},"internalNotes":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":true},"client":{"type":"object","additionalProperties":true,"description":"`{ id, fullName, email }`","nullable":true},"service":{"type":"object","additionalProperties":true,"description":"`{ id, name, color, imageUrl, archived }` — `archived: true` for a service since archived from the catalogue: the appointment keeps it.","nullable":true},"location":{"type":"object","additionalProperties":true,"description":"`{ id, name, city }`","nullable":true},"participants":{"type":"array","items":{"type":"object","additionalProperties":true}}}},"Client":{"type":"object","description":"A person (`kind=INDIVIDUAL`) or a company (`kind=COMPANY`) of the address book. List items add counts (`apptCount`, `nextApptAt`, `siteCount`, `contactCount`, `primaryContact`…); `view=list` returns a shorter row.","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["INDIVIDUAL","COMPANY"]},"fullName":{"type":"string"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"companyId":{"type":"string","description":"The company a person belongs to.","nullable":true},"types":{"type":"array","items":{"type":"string","enum":["CLIENT","SUPPLIER","PARTNER"]}},"specialties":{"type":"array","items":{"type":"string"}},"trade":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"siret":{"type":"string","nullable":true},"vatNumber":{"type":"string","nullable":true},"address":{"type":"object","additionalProperties":true,"nullable":true},"language":{"type":"string","nullable":true},"birthdate":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"customFields":{"type":"object","additionalProperties":true,"description":"Keyed by the custom field `key` (see `GET /fields`)."},"noShowCount":{"type":"integer"},"cancellationCount":{"type":"integer"},"ltvCents":{"type":"integer"},"lastVisitAt":{"type":"string","format":"date-time","nullable":true},"mergedIntoId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"contactCount":{"type":"integer"},"siteCount":{"type":"integer"},"primaryContact":{"type":"object","additionalProperties":true,"nullable":true}}},"ClientDetail":{"allOf":[{"$ref":"#/components/schemas/Client"},{"type":"object","properties":{"contactCount":{"type":"integer","description":"People attached to this account (0 when none)."},"siteCount":{"type":"integer","description":"Sites the account owns (0 when none)."},"primaryContact":{"type":"object","description":"The primary person, else the first one; `null` when the account has none.","properties":{"id":{"type":"string"},"fullName":{"type":"string"},"email":{"type":"string","nullable":true},"phone":{"type":"string","description":"Phone, else mobile.","nullable":true},"role":{"type":"string","nullable":true}},"required":["id","fullName","email","phone","role"],"nullable":true}},"required":["contactCount","siteCount","primaryContact"]}]},"Contact":{"type":"object","description":"A person attached to an account (a company or a household).","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"clientName":{"type":"string"},"clientKind":{"type":"string"},"civility":{"type":"string","nullable":true},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"fullName":{"type":"string"},"role":{"type":"string","nullable":true},"jobTitle":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"mobile":{"type":"string","nullable":true},"isPrimary":{"type":"boolean"},"notes":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"Company":{"type":"object","description":"A `kind=COMPANY` client in the company layout: `name` instead of `fullName`, flat address fields.","properties":{"id":{"type":"string"},"name":{"type":"string"},"types":{"type":"array","items":{"type":"string"}},"specialties":{"type":"array","items":{"type":"string"}},"trade":{"type":"string","nullable":true},"siret":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"address":{"type":"string","nullable":true},"postcode":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"lat":{"type":"number","nullable":true},"lng":{"type":"number","nullable":true},"contactCount":{"type":"integer"},"listName":{"type":"string","nullable":true},"listSource":{"type":"string","nullable":true}}},"CompanyList":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["COMPANY","CONTACT"]},"companyId":{"type":"string","nullable":true},"companyName":{"type":"string","nullable":true},"source":{"type":"string","nullable":true},"exposedInBooking":{"type":"boolean"},"protocol":{"type":"string","nullable":true},"url":{"type":"string","description":"Masked.","nullable":true},"hasCredentials":{"type":"boolean"},"columnMapping":{"type":"object","additionalProperties":true,"nullable":true},"refreshInterval":{"type":"string","nullable":true},"active":{"type":"boolean"},"nextRunAt":{"type":"string","format":"date-time","nullable":true},"lastRunAt":{"type":"string","format":"date-time","nullable":true},"lastStatus":{"type":"string","nullable":true},"lastError":{"type":"string","nullable":true},"lastRowCount":{"type":"integer","nullable":true},"memberCount":{"type":"integer"}}},"Site":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string","description":"Null when a company owns the site (then `companyId` is set).","nullable":true},"clientName":{"type":"string","nullable":true},"companyId":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"address":{"type":"string","description":"The composed one-line address."},"line1":{"type":"string"},"line2":{"type":"string","nullable":true},"postcode":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"lat":{"type":"number","nullable":true},"lng":{"type":"number","nullable":true},"accessNotes":{"type":"string","nullable":true},"contactName":{"type":"string","nullable":true},"contactPhone":{"type":"string","nullable":true},"active":{"type":"boolean"},"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string","nullable":true},"contactId":{"type":"string","nullable":true},"role":{"type":"string","example":"TENANT","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"isPrimary":{"type":"boolean"}}}},"client":{"type":"object","additionalProperties":true,"description":"Detail only: `{ id, fullName, email, phone }`.","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"Equipment":{"type":"object","description":"List rows add `clientName`, `clientKind`, `siteLabel`, `docCount`, `photoCount`, `thumbUrl`.","properties":{"id":{"type":"string"},"label":{"type":"string"},"brand":{"type":"string","nullable":true},"model":{"type":"string","nullable":true},"serialNumber":{"type":"string","nullable":true},"roomLabel":{"type":"string","nullable":true},"power":{"type":"string","nullable":true},"category":{"type":"string","nullable":true},"installedAt":{"type":"string","format":"date-time","nullable":true},"warrantyEndAt":{"type":"string","format":"date-time","nullable":true},"lastMaintenanceAt":{"type":"string","format":"date-time","nullable":true},"nextMaintenanceDueAt":{"type":"string","format":"date-time","nullable":true},"notes":{"type":"string","nullable":true},"active":{"type":"boolean"},"clientId":{"type":"string"},"siteId":{"type":"string","nullable":true},"photos":{"type":"array","items":{"type":"string"}},"customFields":{"type":"object","additionalProperties":true},"createdAt":{"type":"string","format":"date-time"}}},"Contract":{"type":"object","description":"List rows add `clientName`, `clientKind`, `coverageCount`.","properties":{"id":{"type":"string"},"reference":{"type":"string"},"planId":{"type":"string","nullable":true},"planName":{"type":"string","nullable":true},"clientId":{"type":"string"},"contactId":{"type":"string","nullable":true},"siteId":{"type":"string","nullable":true},"status":{"type":"string"},"totalAnnualCents":{"type":"integer"},"currency":{"type":"string"},"vatRate":{"type":"number","nullable":true},"startsOn":{"type":"string"},"endsOn":{"type":"string","nullable":true},"cadenceMonths":{"type":"integer"},"autoRenew":{"type":"boolean"},"noticeDays":{"type":"integer"},"billingDay":{"type":"integer","nullable":true},"notes":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"Service":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"categoryId":{"type":"string","nullable":true},"durationMinutes":{"type":"integer"},"bufferBeforeMin":{"type":"integer"},"bufferAfterMin":{"type":"integer"},"price":{"type":"string","description":"Euros, returned as a decimal string exactly as stored (`\"45\"`, `\"45.5\"`) — parse it, do not compare it as text. In a request body send a number (`45.5`). `null`: no price set.","example":"45.5","nullable":true},"currency":{"type":"string","nullable":true},"vatRate":{"type":"string","nullable":true},"atClientSite":{"type":"boolean"},"bookableOnline":{"type":"boolean"},"color":{"type":"string","nullable":true},"imageUrl":{"type":"string","nullable":true},"position":{"type":"integer"},"active":{"type":"boolean"},"customFields":{"type":"object","additionalProperties":true},"category":{"type":"object","additionalProperties":true,"nullable":true},"variants":{"type":"array","items":{"$ref":"#/components/schemas/ServiceVariant"}},"locationIds":{"type":"array","items":{"type":"string"}}}},"ServiceVariant":{"type":"object","properties":{"id":{"type":"string"},"serviceId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"durationMinutes":{"type":"integer"},"price":{"type":"string","description":"Euros, returned as a decimal string; sent as a number. `null`: the service's price applies.","nullable":true},"position":{"type":"integer"},"active":{"type":"boolean"}}},"ServiceCategory":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","nullable":true},"position":{"type":"integer"},"active":{"type":"boolean"}}},"Location":{"type":"object","description":"A place services happen: an address, a zone or online.","properties":{"id":{"type":"string"},"name":{"type":"string"},"line1":{"type":"string","nullable":true},"line2":{"type":"string","nullable":true},"postcode":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"region":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"lat":{"type":"number","nullable":true},"lng":{"type":"number","nullable":true},"meetingUrl":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"color":{"type":"string","nullable":true},"active":{"type":"boolean"}}},"Member":{"type":"object","properties":{"id":{"type":"string","description":"Membership id — what an appointment's `memberIds` reference."},"userId":{"type":"string"},"name":{"type":"string","nullable":true},"displayName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"role":{"type":"string","enum":["OWNER","ADMIN","MANAGER","COLLABORATOR","VIEWER","ARTISAN"]},"status":{"type":"string"},"color":{"type":"string","nullable":true},"baseAddress":{"type":"object","additionalProperties":true,"nullable":true},"deletedAt":{"type":"string","format":"date-time","nullable":true}}},"Quote":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"status":{"type":"string","enum":["DRAFT","SENT","VIEWED","ACCEPTED","REJECTED","EXPIRED","CANCELLED"]},"clientId":{"type":"string","nullable":true},"clientName":{"type":"string","nullable":true},"contactId":{"type":"string","nullable":true},"siteId":{"type":"string","nullable":true},"appointmentId":{"type":"string","nullable":true},"interventionReportId":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"subtotalCents":{"type":"integer"},"vatCents":{"type":"integer"},"totalCents":{"type":"integer"},"currency":{"type":"string"},"validUntil":{"type":"string","format":"date-time","nullable":true},"sentAt":{"type":"string","format":"date-time","nullable":true},"acceptedAt":{"type":"string","format":"date-time","nullable":true},"rejectedAt":{"type":"string","format":"date-time","nullable":true},"notes":{"type":"string","nullable":true},"legalMentions":{"type":"string","nullable":true},"customFields":{"type":"object","additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"invoice":{"type":"object","additionalProperties":true,"description":"`{ id, reference, status }` of the invoice made from it.","nullable":true}}},"QuoteLine":{"type":"object","properties":{"id":{"type":"string"},"serviceId":{"type":"string","nullable":true},"description":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string"},"unitPriceCents":{"type":"integer"},"discountPercent":{"type":"number","nullable":true},"vatRate":{"type":"number","nullable":true},"position":{"type":"integer"},"catalogRef":{"type":"string","description":"`__section__` / `__text__` for headings and free text.","nullable":true},"purchasePriceCents":{"type":"integer","nullable":true},"marginPercent":{"type":"number","nullable":true},"ecotaxeCents":{"type":"integer","nullable":true}}},"Invoice":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string","description":"Assigned when the invoice is issued.","nullable":true},"status":{"type":"string","enum":["DRAFT","ISSUED","SENT","PAID","PARTIAL","OVERDUE","CANCELLED","REFUNDED"]},"clientId":{"type":"string","nullable":true},"clientName":{"type":"string","nullable":true},"contactId":{"type":"string","nullable":true},"siteId":{"type":"string","nullable":true},"appointmentId":{"type":"string","nullable":true},"quoteId":{"type":"string","nullable":true},"contractId":{"type":"string","nullable":true},"interventionReportId":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"subtotalCents":{"type":"integer"},"vatCents":{"type":"integer"},"totalCents":{"type":"integer"},"paidCents":{"type":"integer"},"vatBreakdown":{"type":"object","additionalProperties":true,"nullable":true},"currency":{"type":"string"},"issuedAt":{"type":"string","format":"date-time","nullable":true},"dueAt":{"type":"string","format":"date-time","nullable":true},"paidAt":{"type":"string","format":"date-time","nullable":true},"notes":{"type":"string","nullable":true},"legalMentions":{"type":"string","nullable":true},"customFields":{"type":"object","additionalProperties":true},"einvoice":{"type":"object","additionalProperties":true,"nullable":true},"createdAt":{"type":"string","format":"date-time"}}},"InvoiceLine":{"type":"object","properties":{"id":{"type":"string"},"serviceId":{"type":"string","nullable":true},"description":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string"},"unitPriceCents":{"type":"integer"},"discountPercent":{"type":"number","nullable":true},"vatRate":{"type":"number","nullable":true},"position":{"type":"integer"}}},"InterventionReport":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string","example":"FI-2026-0042"},"status":{"type":"string","enum":["DRAFT","PLANNED","IN_PROGRESS","COMPLETED","SIGNED","VALIDATED","INVOICED","ARCHIVED"]},"clientId":{"type":"string","nullable":true},"templateId":{"type":"string","nullable":true},"technicianId":{"type":"string","nullable":true},"equipmentIds":{"type":"array","items":{"type":"string"}},"appointmentId":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"workSummary":{"type":"string","nullable":true},"recommendations":{"type":"string","nullable":true},"arrivedAt":{"type":"string","format":"date-time","nullable":true},"departedAt":{"type":"string","format":"date-time","nullable":true},"signedAt":{"type":"string","format":"date-time","nullable":true},"validatedAt":{"type":"string","format":"date-time","nullable":true},"invoicedAt":{"type":"string","format":"date-time","nullable":true},"siteAddress":{"type":"string","nullable":true},"customFields":{"type":"object","additionalProperties":true},"photos":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"createdVia":{"type":"string","nullable":true}}},"InterventionTemplate":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string","nullable":true},"name":{"type":"string"},"kind":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"sections":{"type":"array","items":{"type":"object","additionalProperties":true}},"validations":{"type":"array","items":{"type":"object","additionalProperties":true}},"requiredPhotoTypes":{"type":"array","items":{"type":"string"}},"serviceIds":{"type":"array","items":{"type":"string"}},"requiresClientSignature":{"type":"boolean"},"requiresTechnicianSignature":{"type":"boolean"},"version":{"type":"integer"},"isPreset":{"type":"boolean"},"updatedAt":{"type":"string","format":"date-time"}}},"Document":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"filename":{"type":"string"},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer"},"url":{"type":"string","description":"A signed download URL; refresh it when it expires."},"createdAt":{"type":"string","format":"date-time"}}},"Project":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"name":{"type":"string","nullable":true},"status":{"type":"string","description":"Free text; the app uses DRAFT, PENDING_RESPONSE, PLANNED, IN_PROGRESS, ON_HOLD, DONE, INVOICED, CLOSED, CANCELLED."},"kind":{"type":"string","enum":["CHANTIER","INTERVENTION","AUTRE"]},"collaborative":{"type":"boolean"},"clientId":{"type":"string","nullable":true},"contactId":{"type":"string","nullable":true},"siteId":{"type":"string","nullable":true},"leadMemberId":{"type":"string","nullable":true},"partyRoles":{"type":"array","items":{"type":"string"}},"startsOn":{"type":"string","nullable":true},"endsOn":{"type":"string","nullable":true},"budgetPlannedCents":{"type":"integer","nullable":true},"memberIds":{"type":"array","items":{"type":"string"}},"teamIds":{"type":"array","items":{"type":"string"}},"notes":{"type":"string","nullable":true},"address":{"type":"object","additionalProperties":true,"nullable":true},"customFields":{"type":"object","additionalProperties":true},"createdAt":{"type":"string","format":"date-time"}}},"ProjectListItem":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"name":{"type":"string","nullable":true},"clientId":{"type":"string","nullable":true},"clientName":{"type":"string","nullable":true},"kind":{"type":"string"},"status":{"type":"string"},"city":{"type":"string","nullable":true},"budgetPlannedCents":{"type":"integer","nullable":true},"partners":{"type":"array","items":{"type":"object","additionalProperties":true}},"memberIds":{"type":"array","items":{"type":"string"}},"teamIds":{"type":"array","items":{"type":"string"}},"crewIds":{"type":"array","items":{"type":"string"}},"phaseCount":{"type":"integer"},"phasesDone":{"type":"integer"},"endsOn":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}}},"Task":{"type":"object","properties":{"id":{"type":"string","example":"tsk_…"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["TODO","IN_PROGRESS","DONE","CANCELLED"]},"priority":{"type":"string","enum":["LOW","NORMAL","HIGH","URGENT"]},"dueAt":{"type":"string","format":"date-time","nullable":true},"completedAt":{"type":"string","format":"date-time","nullable":true},"assigneeId":{"type":"string","nullable":true},"references":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"string"},"label":{"type":"string","nullable":true}},"required":["type","id","label"]}},"tags":{"type":"array","items":{"type":"string"}},"customFields":{"type":"object","additionalProperties":true},"links":{"type":"array","items":{"type":"object","additionalProperties":true}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CustomField":{"type":"object","properties":{"id":{"type":"string"},"scope":{"type":"string"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]*$"},"label":{"type":"string"},"type":{"type":"string","enum":["TEXT","LONGTEXT","EMAIL","PHONE","URL","NUMBER","DATE","CHECKBOX","SELECT","MULTI_SELECT","TAG","ADDRESS"]},"config":{"type":"object","additionalProperties":true,"nullable":true},"group":{"type":"string","nullable":true},"position":{"type":"integer"},"required":{"type":"boolean"},"helpText":{"type":"string","nullable":true},"active":{"type":"boolean"}}},"ExternalRef":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"entityType":{"type":"string"},"localId":{"type":"string","description":"The IWANA id."},"externalId":{"type":"string","description":"Your id."},"shopId":{"type":"string","nullable":true},"payloadHash":{"type":"string","nullable":true},"lastSyncedAt":{"type":"string","format":"date-time","nullable":true}}},"CalendarBootstrap":{"type":"object","properties":{"range":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"}},"required":["from","to"]},"closedDays":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"label":{"type":"string"},"kind":{"type":"string","enum":["holiday","closure"]}},"required":["date","label","kind"]}},"holds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"memberId":{"type":"string","description":"Membership id."},"serviceId":{"type":"string","nullable":true},"startAt":{"type":"string","format":"date-time"},"endAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"contactName":{"type":"string","nullable":true}},"required":["id","memberId","serviceId","startAt","endAt","expiresAt","contactName"]},"description":"Slots a customer is booking online right now. Not appointments: they expire on their own."},"appointments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["APPOINTMENT","UNAVAILABILITY"]},"title":{"type":"string","nullable":true},"startAt":{"type":"string","format":"date-time"},"endAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["PENDING","AWAITING_CLIENT","CONFIRMED","IN_PROGRESS","COMPLETED","CANCELLED","NO_SHOW","RESCHEDULED","EXPIRED","REQUEST_REJECTED","OFFER_DECLINED"]},"clientId":{"type":"string","nullable":true},"serviceId":{"type":"string","nullable":true},"locationId":{"type":"string","nullable":true},"internalNotes":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":true},"memberIds":{"type":"array","items":{"type":"string"},"description":"Membership ids of the crew."}},"required":["id","type","title","startAt","endAt","status","clientId","serviceId","locationId","internalNotes","projectId","metadata","memberIds"]},"description":"Everything overlapping the window, blocked slots (`UNAVAILABILITY`) included."},"interventions":{"type":"object","description":"Appointment id → its intervention report id, for the appointments in the window that have one.","additionalProperties":{"type":"string"}},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"fullName":{"type":"string"},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"address":{"type":"object","additionalProperties":true,"nullable":true},"tags":{"type":"array","items":{"type":"string"}}},"required":["id","fullName","email","phone","address","tags"]},"description":"The clients of the window's appointments and the 500 newest, each once."},"services":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","nullable":true},"durationMinutes":{"type":"integer"},"atClientSite":{"type":"boolean"},"active":{"type":"boolean","description":"Bookable. Always `false` for an archived service."},"archived":{"type":"boolean","description":"Archived from the catalogue but still named by an appointment — show it, do not offer it."},"calendarCode":{"type":"string","description":"The short internal name the calendar shows.","nullable":true}},"required":["id","name","color","durationMinutes","atClientSite","active","archived","calendarCode"]},"description":"The live catalogue plus the archived services some appointment still names."},"locations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["FIXED","ZONE","VIRTUAL","PHONE"]},"line1":{"type":"string","nullable":true},"line2":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"postcode":{"type":"string","nullable":true},"lat":{"type":"number","nullable":true},"lng":{"type":"number","nullable":true},"meetingUrl":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true}},"required":["id","name","kind","line1","line2","city","postcode","lat","lng","meetingUrl","phone"]}},"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Membership id."},"displayName":{"type":"string"},"color":{"type":"string","nullable":true},"avatarUrl":{"type":"string","nullable":true}},"required":["id","displayName","color","avatarUrl"]},"description":"Active members, partner companies left out."},"customStatuses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"color":{"type":"string"}},"required":["id","label","color"]},"description":"The workspace's own appointment statuses, if it defined any."},"format":{"type":"object","properties":{"locale":{"type":"string"},"timezone":{"type":"string"}},"required":["locale","timezone"]},"currentMembershipId":{"type":"string","description":"The caller's membership; `null` for an API key.","nullable":true},"userId":{"type":"string","description":"The calling user; absent for an API key."}},"required":["range","closedDays","holds","appointments","interventions","clients","services","locations","members","customStatuses","format","currentMembershipId"]},"Promotion":{"type":"object","description":"On a create, `validFrom`, `validTo` and `maxRedemptions` are absent: the API never sets them.","properties":{"id":{"type":"string"},"code":{"type":"string","description":"The discount code, if any.","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string","enum":["PERCENT","FIXED_AMOUNT","PACKAGE","LOYALTY"]},"amountCents":{"type":"integer","nullable":true},"percent":{"type":"integer","nullable":true},"serviceIds":{"type":"array","items":{"type":"string"}},"validFrom":{"type":"string","format":"date-time","nullable":true},"validTo":{"type":"string","format":"date-time","nullable":true},"maxRedemptions":{"type":"integer","nullable":true},"redeemed":{"type":"integer"},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"ContractTemplate":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"cadenceMonths":{"type":"integer"},"noticeDays":{"type":"integer"},"autoRenew":{"type":"boolean"},"totalAnnualCents":{"type":"integer","nullable":true},"currency":{"type":"string"},"vatRate":{"type":"string","description":"A decimal string, e.g. `\"20\"`.","nullable":true},"serviceIds":{"type":"array","items":{"type":"string"}},"bodyMarkdown":{"type":"string","nullable":true},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"VstItem":{"type":"object","description":"A supplier article. Prices are euros excluding tax, as numbers.","properties":{"id":{"type":"string"},"vendor":{"type":"string","enum":["vst","ims","covap"]},"editable":{"type":"boolean","description":"`false` on a platform-wide article: its coefficients cannot be changed (`403 vst_item_read_only`)."},"codeArticle":{"type":"string"},"designation":{"type":"string"},"prixBaseHt":{"type":"number","nullable":true},"prixAdherentHt":{"type":"number","nullable":true},"prixVenteHt":{"type":"number","nullable":true},"ecotaxeHt":{"type":"number","nullable":true},"activiteLabel":{"type":"string","nullable":true},"familleLabel":{"type":"string","nullable":true},"sousFamilleLabel":{"type":"string","nullable":true},"chapitreLabel":{"type":"string","nullable":true},"activiteCode":{"type":"string","nullable":true},"familleCode":{"type":"string","nullable":true},"sousFamilleCode":{"type":"string","nullable":true},"chapitreCode":{"type":"string","nullable":true},"classement1Code":{"type":"string","nullable":true},"classement2Code":{"type":"string","nullable":true},"classement3Code":{"type":"string","nullable":true},"classement4Code":{"type":"string","nullable":true},"classement5Code":{"type":"string","nullable":true},"classement1Label":{"type":"string","nullable":true},"classement2Label":{"type":"string","nullable":true},"classement3Label":{"type":"string","nullable":true},"classement4Label":{"type":"string","nullable":true},"classement5Label":{"type":"string","nullable":true},"refFournisseur":{"type":"string","nullable":true},"nomFournisseur":{"type":"string","nullable":true},"codeBarre":{"type":"string","nullable":true},"codeAlpha":{"type":"string","nullable":true},"unite":{"type":"string","nullable":true},"imageUrl":{"type":"string","nullable":true},"docUrl":{"type":"string","nullable":true},"articleDivers":{"type":"boolean"},"saisieCommentaire":{"type":"boolean"},"commentaireObligatoire":{"type":"boolean"},"dateImportTarif":{"type":"string","nullable":true},"multipleVente":{"type":"number","nullable":true},"uniteCalculateur":{"type":"string","nullable":true},"coeffUniteCalculateur":{"type":"number","nullable":true},"coeffAchat":{"type":"number"},"coeffRevente":{"type":"number"},"coeffVente":{"type":"number"}},"required":["id","vendor","editable","codeArticle","designation","prixBaseHt","prixAdherentHt","prixVenteHt","ecotaxeHt","activiteLabel","familleLabel","sousFamilleLabel","chapitreLabel","activiteCode","familleCode","sousFamilleCode","chapitreCode","classement1Code","classement2Code","classement3Code","classement4Code","classement5Code","classement1Label","classement2Label","classement3Label","classement4Label","classement5Label","refFournisseur","nomFournisseur","codeBarre","codeAlpha","unite","imageUrl","docUrl","articleDivers","saisieCommentaire","commentaireObligatoire","dateImportTarif","multipleVente","uniteCalculateur","coeffUniteCalculateur","coeffAchat","coeffRevente","coeffVente"]},"CommunicationsBootstrap":{"type":"object","properties":{"orgName":{"type":"string"},"logoUrl":{"type":"string","nullable":true},"locale":{"type":"string","nullable":true},"senderEmail":{"type":"string","nullable":true},"smsSenderId":{"type":"string","nullable":true},"canEdit":{"type":"boolean"},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"channel":{"type":"string","enum":["EMAIL","SMS","WHATSAPP","PUSH","IN_APP","VOICE"]},"type":{"type":"string","description":"Which letter it was, by its Notifications name."},"subject":{"type":"string","nullable":true},"excerpt":{"type":"string","description":"The start of the message as plain text.","nullable":true},"toEmail":{"type":"string","nullable":true},"toPhone":{"type":"string","nullable":true},"status":{"type":"string","enum":["QUEUED","SENT","DELIVERED","OPENED","CLICKED","FAILED","BOUNCED","COMPLAINED","SUPPRESSED"]},"failureReason":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","channel","type","subject","excerpt","toEmail","toPhone","status","failureReason","createdAt"]},"description":"The 50 latest sends, newest first. The message itself: `GET /communications/history/{id}`."},"templates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"channel":{"type":"string","enum":["EMAIL","SMS","WHATSAPP","PUSH","IN_APP","VOICE"]},"contextType":{"type":"string"},"status":{"type":"string","enum":["DRAFT","ACTIVE","ARCHIVED"]},"language":{"type":"string","nullable":true},"internalDescription":{"type":"string","nullable":true},"branding":{"type":"string","enum":["PLATFORM","CUSTOM"]},"locked":{"type":"boolean","description":"IWANA's own wording: read-only."},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","channel","contextType","status","language","internalDescription","branding","locked","updatedAt"]}},"campaigns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"channel":{"type":"string","enum":["EMAIL","SMS","WHATSAPP","PUSH","IN_APP","VOICE"]},"status":{"type":"string","enum":["DRAFT","SCHEDULED","RUNNING","COMPLETED","CANCELLED"]},"internalDescription":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true},"body":{"type":"string"},"perRecipientDateField":{"type":"string","nullable":true},"recipientFilter":{"type":"object","additionalProperties":true,"nullable":true},"recipientIds":{"type":"array","items":{"type":"string"},"nullable":true},"scheduleKind":{"type":"string","enum":["IMMEDIATE","ONE_OFF","PER_RECIPIENT_DATE"]},"scheduledAt":{"type":"string","format":"date-time","nullable":true},"recipientKind":{"type":"string","enum":["ALL","MANUAL","FILTERED"]},"totalRecipients":{"type":"integer"},"sentCount":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","channel","status","internalDescription","subject","body","perRecipientDateField","recipientFilter","recipientIds","scheduleKind","scheduledAt","recipientKind","totalRecipients","sentCount","createdAt","updatedAt"]}}},"required":["orgName","logoUrl","locale","senderEmail","smsSenderId","canEdit","history","templates","campaigns"]},"NotificationSettings":{"type":"object","properties":{"canEdit":{"type":"boolean"},"brand":{"type":"object","properties":{"orgName":{"type":"string"},"name":{"type":"string","description":"The sender name letters show."},"logoUrl":{"type":"string","nullable":true},"color":{"type":"string","nullable":true},"mode":{"type":"string","enum":["custom","platform"]},"senderEmail":{"type":"string","nullable":true},"smsSenderId":{"type":"string","nullable":true}},"required":["orgName","name","logoUrl","color","mode","senderEmail","smsSenderId"]},"proNotes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"serviceId":{"type":"string","nullable":true},"enabled":{"type":"boolean"}},"required":["id","text","serviceId","enabled"]},"description":"The notes added to booking letters, per service or for all (`serviceId: null`)."},"testRecipient":{"type":"object","properties":{"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true}},"required":["email","phone"],"description":"Where a test goes by default: the calling user's email and phone, both `null` for an API key."},"services":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"section":{"type":"string","enum":["booking","satisfaction","projects","custom"],"description":"`custom`: the workspace's own letters."},"channel":{"type":"string","enum":["EMAIL","SMS"]},"enabled":{"type":"boolean"},"booking":{"type":"boolean","description":"A booking letter: the pro notes join it."},"letter":{"type":"object","properties":{"source":{"type":"string","enum":["template","automation"]},"editable":{"type":"boolean"},"customized":{"type":"boolean"},"subject":{"type":"string"},"body":{"type":"string"},"variables":{"type":"array","items":{"type":"string"},"description":"The `{{variables}}` the wording may use."},"original":{"type":"object","description":"The default wording; `null` when there is none.","properties":{"subject":{"type":"string"},"body":{"type":"string"}},"required":["subject","body"],"nullable":true}},"required":["source","editable","customized","subject","body","variables","original"]}},"required":["id","label","description","section","channel","enabled","booking","letter"]}}},"required":["canEdit","brand","proNotes","testRecipient","services","events"]},"DashboardStats":{"type":"object","properties":{"label":{"type":"string","description":"The period in words, in French."},"currentRange":{"type":"string","enum":["7d","30d","90d","ytd","mtd","custom"]},"tiles":{"type":"object","properties":{"bookings":{"type":"object","description":"`delta`: change against the previous period of the same length, as a ratio; `null` when that period had none.","properties":{"value":{"type":"integer"},"delta":{"type":"number","nullable":true}},"required":["value","delta"]},"revenue":{"type":"object","description":"Succeeded payments, cents.","properties":{"value":{"type":"integer"},"delta":{"type":"number","nullable":true}},"required":["value","delta"]},"completionRate":{"type":"number","description":"0–1."},"noShow":{"type":"integer"},"cancelled":{"type":"integer"},"noShowRate":{"type":"number","description":"0–1."},"clientsTotal":{"type":"integer"},"newClients":{"type":"integer"},"equipmentTotal":{"type":"integer"},"equipmentNew":{"type":"integer"},"activeContractCount":{"type":"integer"},"recurringRevenue":{"type":"integer","description":"Annual cents of the active contracts."},"pendingQuoteCount":{"type":"integer"},"pendingQuoteAmount":{"type":"integer","description":"Cents."},"outstandingInvoiceCount":{"type":"integer"},"overdueInvoiceCount":{"type":"integer"},"outstandingAmount":{"type":"integer","description":"Cents still due."},"notifications":{"type":"integer","description":"Messages sent in the period."}},"required":["bookings","revenue","completionRate","noShow","cancelled","noShowRate","clientsTotal","newClients","equipmentTotal","equipmentNew","activeContractCount","recurringRevenue","pendingQuoteCount","pendingQuoteAmount","outstandingInvoiceCount","overdueInvoiceCount","outstandingAmount","notifications"]},"revenueSeries":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string","format":"date"},"value":{"type":"number"}},"required":["bucket","value"]},"description":"Euros per day — not cents."},"bookingsSeries":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string","format":"date"},"value":{"type":"number"}},"required":["bucket","value"]}},"equipmentGrowthSeries":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string","format":"date"},"value":{"type":"number"}},"required":["bucket","value"]}},"clientGrowthSeries":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string","format":"date"},"value":{"type":"number"}},"required":["bucket","value"]}},"statusBreakdown":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The status."},"value":{"type":"integer"}},"required":["name","value"]}},"memberBreakdown":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Membership id, or `unassigned`."},"name":{"type":"string"},"image":{"type":"string","nullable":true},"color":{"type":"string","nullable":true},"value":{"type":"integer"}},"required":["id","name","image","color","value"]},"description":"Appointments per member; a job with two members counts for both."},"sendSeries":{"type":"object","properties":{"email":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string","format":"date"},"value":{"type":"number"}},"required":["bucket","value"]}},"sms":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string","format":"date"},"value":{"type":"number"}},"required":["bucket","value"]}}},"required":["email","sms"]},"sendByType":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The template name."},"points":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string","format":"date"},"value":{"type":"number"}},"required":["bucket","value"]}}},"required":["name","points"]}},"contractSeries":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string","format":"date"},"value":{"type":"number"}},"required":["bucket","value"]},"description":"Active contracts on each day."},"contractStatusBreakdown":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The status."},"value":{"type":"integer"}},"required":["name","value"]}},"projectStatusBreakdown":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The status."},"value":{"type":"integer"}},"required":["name","value"]}},"quoteStatusBreakdown":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The status."},"value":{"type":"integer"}},"required":["name","value"]}},"invoiceStatusBreakdown":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The status."},"value":{"type":"integer"}},"required":["name","value"]}},"locationHeatmap":{"type":"array","items":{"type":"object","properties":{"lat":{"type":"number"},"lng":{"type":"number"},"value":{"type":"integer"},"label":{"type":"string"}},"required":["lat","lng","value","label"]}},"appointmentPins":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"lat":{"type":"number"},"lng":{"type":"number"},"title":{"type":"string"},"subtitle":{"type":"string","nullable":true},"at":{"type":"string","format":"date-time"},"status":{"type":"string"},"customStatusId":{"type":"string","nullable":true},"serviceId":{"type":"string","nullable":true},"memberIds":{"type":"array","items":{"type":"string"}}},"required":["id","lat","lng","title","subtitle","at","status","customStatusId","serviceId","memberIds"]},"description":"One pin per located appointment, the 1 500 most recent at most."},"customStatuses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"color":{"type":"string"}},"required":["id","label","color"]}},"hourHeatmap":{"type":"array","items":{"type":"object","properties":{"dow":{"type":"integer","description":"0 = Sunday."},"hour":{"type":"integer"},"value":{"type":"integer"}},"required":["dow","hour","value"]},"description":"When appointments start, in the workspace time zone; empty cells are left out."},"bookingActivity":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["created","modified","cancelled","confirmed"]},"dow":{"type":"integer","description":"0 = Sunday."},"hour":{"type":"integer"},"value":{"type":"integer"}},"required":["kind","dow","hour","value"]},"description":"When bookings were requested, confirmed, changed or cancelled, in the workspace time zone. `created`: an appointment born as a request (pending or proposed), at its creation. `confirmed`: a change of status to confirmed, or an appointment confirmed from the start (instant online booking, entered by the team, imported), at its creation. Each action counts once."},"bookedBy":{"type":"array","items":{"type":"object","properties":{"who":{"type":"string","enum":["online","dashboard","leo","sync"]},"value":{"type":"integer"}},"required":["who","value"]}},"serviceBreakdown":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Service id, or `unknown`."},"name":{"type":"string"},"color":{"type":"string","nullable":true},"categoryId":{"type":"string","description":"The service category, described in `serviceCategories`; `null` without one.","nullable":true},"value":{"type":"integer"}},"required":["id","name","color","categoryId","value"]}},"serviceCategories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","nullable":true}},"required":["id","name","color"]},"description":"The categories `serviceBreakdown` refers to, inactive ones included."}},"required":["label","currentRange","tiles","revenueSeries","bookingsSeries","equipmentGrowthSeries","clientGrowthSeries","statusBreakdown","memberBreakdown","sendSeries","sendByType","contractSeries","contractStatusBreakdown","projectStatusBreakdown","quoteStatusBreakdown","invoiceStatusBreakdown","locationHeatmap","appointmentPins","customStatuses","hourHeatmap","bookingActivity","bookedBy","serviceBreakdown","serviceCategories"]},"DashboardSatisfaction":{"type":"object","properties":{"range":{"type":"object","properties":{"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"}},"required":["from","to"]},"totals":{"type":"object","properties":{"responses":{"type":"object","description":"Reviews received in the period; `delta` as a ratio, `null` when the previous period had none.","properties":{"value":{"type":"integer"},"delta":{"type":"number","nullable":true}},"required":["value","delta"]},"ratingAvg":{"type":"object","description":"Average 1–5 rating, to one decimal.","properties":{"value":{"type":"number","nullable":true},"delta":{"type":"number","nullable":true}},"required":["value","delta"]},"ratingCount":{"type":"integer"},"nps":{"type":"integer","description":"Net Promoter Score (−100 to 100) over the answers with a 0–10 score.","nullable":true},"npsSample":{"type":"integer"},"requests":{"type":"object","description":"Review requests sent by the after-visit automation in the period, one per appointment.","properties":{"value":{"type":"integer"},"delta":{"type":"number","nullable":true}},"required":["value","delta"]},"answered":{"type":"integer","description":"Requests of the period whose appointment has a review."},"responseRate":{"type":"object","description":"`answered / requests`, 0–1; `null` without a request.","properties":{"value":{"type":"number","nullable":true},"delta":{"type":"number","nullable":true}},"required":["value","delta"]}},"required":["responses","ratingAvg","ratingCount","nps","npsSample","requests","answered","responseRate"]},"distribution":{"type":"array","items":{"type":"object","properties":{"rating":{"type":"integer","enum":[1,2,3,4,5]},"value":{"type":"integer"}},"required":["rating","value"]}},"series":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","format":"date"},"responses":{"type":"integer"},"ratingAvg":{"type":"number","nullable":true}},"required":["day","responses","ratingAvg"]}}},"required":["range","totals","distribution","series"]},"DashboardVoice":{"type":"object","properties":{"range":{"type":"object","properties":{"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"}},"required":["from","to"]},"totals":{"type":"object","properties":{"calls":{"type":"object","properties":{"value":{"type":"integer"},"delta":{"type":"number","nullable":true}},"required":["value","delta"]},"durationSec":{"type":"object","properties":{"value":{"type":"integer"},"delta":{"type":"number","nullable":true}},"required":["value","delta"]},"avgDurationSec":{"type":"object","properties":{"value":{"type":"integer","nullable":true},"delta":{"type":"number","nullable":true}},"required":["value","delta"]},"booked":{"type":"object","description":"Calls where the assistant booked an appointment.","properties":{"value":{"type":"integer"},"delta":{"type":"number","nullable":true}},"required":["value","delta"]},"transferred":{"type":"object","description":"Calls passed on to someone in the team.","properties":{"value":{"type":"integer"},"delta":{"type":"number","nullable":true}},"required":["value","delta"]}},"required":["calls","durationSec","avgDurationSec","booked","transferred"]},"outcomes":{"type":"array","items":{"type":"object","properties":{"outcome":{"type":"string","enum":["HANDLED","TRANSFERRED","TASK","BOOKED","RESCHEDULED","CANCELLED"]},"value":{"type":"integer"}},"required":["outcome","value"]}},"intents":{"type":"array","items":{"type":"object","properties":{"intent":{"type":"string"},"value":{"type":"integer"}},"required":["intent","value"]}},"series":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","format":"date"},"calls":{"type":"integer"},"booked":{"type":"integer"},"transferred":{"type":"integer"}},"required":["day","calls","booked","transferred"]}}},"required":["range","totals","outcomes","intents","series"]},"DashboardCampaigns":{"type":"object","properties":{"range":{"type":"object","properties":{"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"}},"required":["from","to"]},"totals":{"type":"object","properties":{"sends":{"type":"object","description":"Campaign messages logged: sent, failed or held back.","properties":{"value":{"type":"integer"},"delta":{"type":"number","nullable":true}},"required":["value","delta"]},"sent":{"type":"integer"},"failed":{"type":"integer","description":"Failed, bounced or complained."},"suppressed":{"type":"integer","description":"Held back for lack of credits."},"campaigns":{"type":"integer","description":"Campaigns that sent at least one message."}},"required":["sends","sent","failed","suppressed","campaigns"]},"byChannel":{"type":"object","properties":{"email":{"type":"integer"},"sms":{"type":"integer"}},"required":["email","sms"]},"campaigns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"channel":{"type":"string","enum":["EMAIL","SMS"]},"sends":{"type":"integer"},"sent":{"type":"integer"},"failed":{"type":"integer"}},"required":["id","name","channel","sends","sent","failed"]}},"series":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","format":"date"},"email":{"type":"integer"},"sms":{"type":"integer"}},"required":["day","email","sms"]}}},"required":["range","totals","byChannel","campaigns","series"]},"DashboardClients":{"type":"object","properties":{"range":{"type":"object","properties":{"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"}},"required":["from","to"]},"totals":{"type":"object","properties":{"clients":{"type":"integer"},"individuals":{"type":"integer"},"companies":{"type":"integer"},"newClients":{"type":"object","description":"Records created in IWANA during the period — imports, lists and Codial excluded.","properties":{"value":{"type":"integer"},"previous":{"type":"integer"},"delta":{"type":"number","nullable":true}},"required":["value","previous","delta"]},"imported":{"type":"integer","description":"Records imported (file, list, Codial) during the period."}},"required":["clients","individuals","companies","newClients","imported"]},"series":{"type":"array","items":{"type":"object","description":"New clients that day.","properties":{"day":{"type":"string","format":"date"},"value":{"type":"integer"}},"required":["day","value"]}},"origins":{"type":"array","items":{"type":"object","properties":{"origin":{"type":"string","enum":["manual","online","ai","import","codial","other"]},"total":{"type":"integer"},"period":{"type":"integer"}},"required":["origin","total","period"]}},"contact":{"type":"object","properties":{"email":{"type":"integer"},"phone":{"type":"integer"},"both":{"type":"integer"},"none":{"type":"integer"},"emailReachable":{"type":"integer"},"smsReachable":{"type":"integer","description":"French or overseas-department mobile number."}},"required":["email","phone","both","none","emailReachable","smsReachable"]},"activity":{"type":"object","description":"Partition of the file by last appointment held, at the end of the period.","properties":{"active":{"type":"integer"},"recent":{"type":"integer"},"dormant6to12":{"type":"integer"},"dormant12":{"type":"integer"},"never":{"type":"integer"}},"required":["active","recent","dormant6to12","dormant12","never"]},"loyalty":{"type":"object","properties":{"loyal":{"type":"integer","description":"Clients with 2+ appointments in the 12 months ending with the period."},"top":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"visits":{"type":"integer"},"periodVisits":{"type":"integer"},"lastVisit":{"type":"string","format":"date-time","nullable":true}},"required":["id","name","visits","periodVisits","lastVisit"]}}},"required":["loyal","top"]},"reliability":{"type":"object","description":"Appointments of the period.","properties":{"noShowClients":{"type":"integer"},"cancelClients":{"type":"integer"},"noShows":{"type":"integer"},"cancellations":{"type":"integer"},"top":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"noShows":{"type":"integer"},"cancellations":{"type":"integer"}},"required":["id","name","noShows","cancellations"]}}},"required":["noShowClients","cancelClients","noShows","cancellations","top"]},"geography":{"type":"object","properties":{"located":{"type":"integer"},"cities":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"integer"}},"required":["name","value"]}},"postcodes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"integer"}},"required":["name","value"]}}},"required":["located","cities","postcodes"]},"tags":{"type":"object","properties":{"tagged":{"type":"integer"},"top":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"integer"}},"required":["name","value"]}}},"required":["tagged","top"]},"segments":{"type":"object","properties":{"segmented":{"type":"integer"},"top":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"integer"}},"required":["name","value"]}}},"required":["segmented","top"]}},"required":["range","totals","series","origins","contact","activity","loyalty","reliability","geography","tags","segments"]}}},"paths":{"/pro/activity-log":{"get":{"operationId":"getActivityLog","tags":["Statistiques"],"summary":"The workspace activity feed, newest first","description":"Cursor paging: pass `nextBefore` as `before`.","security":[{"apiKey":[]}],"parameters":[{"name":"before","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"description":"1–200, default 50 (outside the range: 400)."},{"name":"kinds","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated: `appointment`, `client`, `quote`, `invoice`, `automation`, `message`, `campaign`."},{"name":"q","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"at":{"type":"string","format":"date-time"},"kind":{"type":"string"},"action":{"type":"string"},"label":{"type":"string"},"subject":{"type":"object","additionalProperties":true,"nullable":true},"actor":{"type":"object","additionalProperties":true},"channel":{"type":"string","nullable":true},"outcome":{"type":"string","nullable":true},"detail":{"type":"object","additionalProperties":true,"nullable":true}},"required":["id","at","kind","action","label","subject","actor","channel","outcome","detail"]}},"nextBefore":{"type":"string","format":"date-time","nullable":true}},"required":["items","nextBefore"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/appointments":{"get":{"operationId":"getAppointments","tags":["Rendez-vous"],"summary":"List appointments","description":"Filters combine. `from`/`to` bound `startAt`. Without `type`, only `APPOINTMENT` rows (not blocked slots) are returned. `clientId` also matches appointments where the contact is a secondary participant.","security":[{"apiKey":[]}],"parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["PENDING","AWAITING_CLIENT","CONFIRMED","IN_PROGRESS","COMPLETED","CANCELLED","NO_SHOW","RESCHEDULED","EXPIRED","REQUEST_REJECTED","OFFER_DECLINED"]}},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["APPOINTMENT","UNAVAILABILITY"]},"description":"`APPOINTMENT` (default) or `UNAVAILABILITY` (blocked slots)."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":200},"description":"Default 200; a larger value is lowered to 500."},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"]},"description":"By `startAt`; `desc` by default."},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"siteId","in":"query","required":false,"schema":{"type":"string"},"description":"Everything that happened at one site."},{"name":"companyId","in":"query","required":false,"schema":{"type":"string"},"description":"A company: the appointments of its people and of its sites."},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"},"description":"The appointments attached to one project."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"search","in":"query","required":false,"schema":{"type":"string","maxLength":200},"description":"Free text over client, service, location and notes."},{"name":"statuses","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated statuses."},{"name":"notStatuses","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated statuses to leave out."},{"name":"serviceIds","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated service ids."},{"name":"memberIds","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated membership ids: the jobs assigned to them."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"Page size 200 by default, 500 at most; `limit` and `offset` are echoed back.","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AppointmentListItem"}},"total":{"type":"integer","description":"Rows matching the filter, ignoring paging."},"limit":{"type":"integer"},"offset":{"type":"integer"}},"required":["items","total","limit","offset"]},"example":{"items":[{"id":"a9s4d7f2g5h8j1k3l6z0x2c5","type":"APPOINTMENT","title":"Entretien chaudière","status":"CONFIRMED","source":"API","startAt":"2026-11-18T09:00:00.000Z","endAt":"2026-11-18T10:30:00.000Z","clientId":"k7m2x9q4w1e8r5t3y6u0i2o4","contactId":null,"serviceId":"s2d5f8g1h4j7k0l3z6x9c2v5","locationId":"l4k7j0h3g6f9d2s5a8q1w4e7","siteId":null,"internalNotes":"Prévoir le kit de joints.","metadata":{},"client":{"id":"k7m2x9q4w1e8r5t3y6u0i2o4","fullName":"Camille Durand","email":"camille.durand@example.com"},"service":{"id":"s2d5f8g1h4j7k0l3z6x9c2v5","name":"Entretien chaudière gaz","color":"#0E7C86","imageUrl":null},"location":{"id":"l4k7j0h3g6f9d2s5a8q1w4e7","name":"Atelier Nantes","city":"Nantes"},"participants":[]}],"total":1,"limit":200,"offset":0}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postAppointments","tags":["Rendez-vous"],"summary":"Create or update an appointment","description":"One endpoint for both: send `id` to update (an unknown `id` is a `404`, never a create), omit it to create. `startAt` and `endAt` are always required, an update included, with `startAt` before `endAt` (`400 invalid_range`). A create needs `serviceId` for an `APPOINTMENT` (`service_required`) and `title` for an `UNAVAILABILITY`; `clientId` is optional. Status defaults to `PENDING`. On an update an omitted field keeps its stored value and an explicit `null` clears it; `memberIds`, `participants`, `metadata` and `customFields` replace the stored value when sent. Every referenced id (client, service, site, location, project, member) must belong to the workspace (`400 <x>_not_found`). `source` is stamped `API` unless you send one. Emits `appointment.created`, `appointment.updated` or `appointment.cancelled`. To change only the status use `PATCH /appointments/{id}/status`.\n\nSend `Idempotency-Key` to make a retry safe: the same key within 48 h replays the first response.","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["APPOINTMENT","UNAVAILABILITY"]},"serviceId":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"startAt":{"type":"string","format":"date-time"},"endAt":{"type":"string","format":"date-time"},"clientId":{"type":"string","nullable":true},"contactId":{"type":"string","description":"A person of the `clientId` account (see `/contacts`); another account's person is a 400.","nullable":true},"participants":{"type":"array","items":{"type":"object","properties":{"clientId":{"type":"string","maxLength":64},"contactId":{"type":"string","maxLength":64,"nullable":true},"notify":{"type":"boolean","description":"Whether this participant receives the appointment's messages; `true` by default."},"isPrimary":{"type":"boolean","description":"At most one main participant; when none is marked, the first of the list is."}},"required":["clientId"],"additionalProperties":false},"maxItems":50,"description":"Every participant, the main one included. When sent it is authoritative: the main participant becomes `clientId` / `contactId` and the others follow the list (`[]` removes the client). Omitted: nothing changes."},"locationId":{"type":"string","nullable":true},"siteId":{"type":"string","description":"The registered site this happens at — written alongside the address text, never instead of it.","nullable":true},"projectId":{"type":"string","description":"The project this appointment belongs to; `null` detaches it.","nullable":true},"status":{"type":"string","enum":["PENDING","AWAITING_CLIENT","CONFIRMED","IN_PROGRESS","COMPLETED","CANCELLED","NO_SHOW","RESCHEDULED","EXPIRED","REQUEST_REJECTED","OFFER_DECLINED"]},"internalNotes":{"type":"string","nullable":true},"clientNotes":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":true},"memberIds":{"type":"array","items":{"type":"string"},"description":"The whole crew, as membership ids (see `GET /team`): replaces the assigned members, `[]` clears them. Omitted: the crew is kept."},"customFields":{"type":"object","additionalProperties":true},"source":{"type":"string","enum":["DASHBOARD","WIDGET","MARKETPLACE","API","AI_ASSISTANT","WORKFLOW","IMPORT","PLUGIN"]}},"required":["startAt","endAt"],"additionalProperties":false},"example":{"title":"Entretien chaudière","startAt":"2026-11-18T09:00:00.000Z","endAt":"2026-11-18T10:30:00.000Z","serviceId":"s2d5f8g1h4j7k0l3z6x9c2v5","locationId":"l4k7j0h3g6f9d2s5a8q1w4e7","clientId":"k7m2x9q4w1e8r5t3y6u0i2o4","memberIds":["m1n4b7v0c3x6z9l2k5j8h1g4"],"status":"CONFIRMED","clientNotes":"Accès par le garage."}}}},"responses":{"201":{"description":"Created or updated (201 in both cases). The saved appointment's own columns, ids included (`clientId`, `serviceId`, `siteId`…); `members` only when the body sent `memberIds`. The joined `client`, `service`, `location`, `site`, `participants`, `report` and history are only on `GET /appointments/{id}`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Appointment"},"example":{"id":"a9s4d7f2g5h8j1k3l6z0x2c5","type":"APPOINTMENT","title":"Entretien chaudière","status":"CONFIRMED","source":"API","startAt":"2026-11-18T09:00:00.000Z","endAt":"2026-11-18T10:30:00.000Z","timezone":"Europe/Paris","clientId":"k7m2x9q4w1e8r5t3y6u0i2o4","contactId":null,"serviceId":"s2d5f8g1h4j7k0l3z6x9c2v5","locationId":"l4k7j0h3g6f9d2s5a8q1w4e7","siteId":null,"projectId":null,"clientNotes":"Accès par le garage.","internalNotes":"Prévoir le kit de joints.","metadata":{},"customFields":{},"client":{"id":"k7m2x9q4w1e8r5t3y6u0i2o4","fullName":"Camille Durand","email":"camille.durand@example.com","phone":"+33612345678"},"service":{"id":"s2d5f8g1h4j7k0l3z6x9c2v5","name":"Entretien chaudière gaz","color":"#0E7C86","imageUrl":null},"location":{"id":"l4k7j0h3g6f9d2s5a8q1w4e7","name":"Atelier Nantes","city":"Nantes"},"site":null,"members":[{"id":"m1n4b7v0c3x6z9l2k5j8h1g4","displayName":"Julien Martin","avatar":null,"color":"#F59E0B"}],"participants":[],"photos":[],"report":null,"activeContract":null,"totalAmountCents":12000,"depositAmountCents":null,"currency":"EUR","completedAt":null,"cancelledAt":null,"noShowAt":null,"createdAt":"2026-11-10T14:05:11.000Z","updatedAt":"2026-11-10T14:05:11.000Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/appointments/{id}":{"delete":{"operationId":"deleteAppointmentsId","tags":["Rendez-vous"],"summary":"Cancel and remove an appointment","description":"Sets the status to `CANCELLED` and soft-deletes the rendez-vous (and the generated occurrences of a recurring one): afterwards `GET` answers `404` and lists no longer return it. Emits `appointment.cancelled`. To keep a cancelled rendez-vous visible, use `PATCH …/status` with `CANCELLED` instead.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"get":{"operationId":"getAppointmentsId","tags":["Rendez-vous"],"summary":"Get one appointment, with client, service, crew, site and report","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Appointment"},"example":{"id":"a9s4d7f2g5h8j1k3l6z0x2c5","type":"APPOINTMENT","title":"Entretien chaudière","status":"CONFIRMED","source":"API","startAt":"2026-11-18T09:00:00.000Z","endAt":"2026-11-18T10:30:00.000Z","timezone":"Europe/Paris","clientId":"k7m2x9q4w1e8r5t3y6u0i2o4","contactId":null,"serviceId":"s2d5f8g1h4j7k0l3z6x9c2v5","locationId":"l4k7j0h3g6f9d2s5a8q1w4e7","siteId":null,"projectId":null,"clientNotes":"Accès par le garage.","internalNotes":"Prévoir le kit de joints.","metadata":{},"customFields":{},"client":{"id":"k7m2x9q4w1e8r5t3y6u0i2o4","fullName":"Camille Durand","email":"camille.durand@example.com","phone":"+33612345678"},"service":{"id":"s2d5f8g1h4j7k0l3z6x9c2v5","name":"Entretien chaudière gaz","color":"#0E7C86","imageUrl":null},"location":{"id":"l4k7j0h3g6f9d2s5a8q1w4e7","name":"Atelier Nantes","city":"Nantes"},"site":null,"members":[{"id":"m1n4b7v0c3x6z9l2k5j8h1g4","displayName":"Julien Martin","avatar":null,"color":"#F59E0B"}],"participants":[],"photos":[],"report":null,"activeContract":null,"totalAmountCents":12000,"depositAmountCents":null,"currency":"EUR","completedAt":null,"cancelledAt":null,"noShowAt":null,"createdAt":"2026-11-10T14:05:11.000Z","updatedAt":"2026-11-10T14:05:11.000Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/appointments/{id}/history":{"get":{"operationId":"getAppointmentsIdHistory","tags":["Rendez-vous"],"summary":"The audit trail of one appointment, newest first","description":"Event kinds: `modification` (field changes), `status`, `cancellation`, `notification` (messages sent), `creation`.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["modification","status","cancellation","notification","creation"]},"at":{"type":"string","format":"date-time"}},"required":["kind","at"]}}},"required":["events"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/appointments/{id}/status":{"patch":{"operationId":"patchAppointmentsIdStatus","tags":["Rendez-vous"],"summary":"Change the status of an appointment","description":"Only the status moves (and its `cancelledAt` / `completedAt` / `noShowAt` stamp). Emits `appointment.cancelled` for `CANCELLED`, `appointment.updated` otherwise; nothing when the status is unchanged.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","AWAITING_CLIENT","CONFIRMED","IN_PROGRESS","COMPLETED","CANCELLED","NO_SHOW","RESCHEDULED","EXPIRED","REQUEST_REJECTED","OFFER_DECLINED"]}},"required":["status"],"additionalProperties":false},"example":{"status":"COMPLETED"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"example":{"ok":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/appointments/counts":{"get":{"operationId":"getAppointmentsCounts","tags":["Rendez-vous"],"summary":"Counts per tab (all, upcoming, today, requests, cancelled, history)","description":"`APPOINTMENT` rows only. `today` uses the workspace time zone; `cancelled` counts CANCELLED, REQUEST_REJECTED and OFFER_DECLINED.","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"all":{"type":"integer"},"upcoming":{"type":"integer"},"today":{"type":"integer"},"requests":{"type":"integer"},"requestsPending":{"type":"integer"},"cancelled":{"type":"integer"},"history":{"type":"integer"}},"required":["all","upcoming","today","requests","requestsPending","cancelled","history"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/availability":{"get":{"operationId":"getAvailability","tags":["Disponibilités"],"summary":"Closure days and observed bank holidays","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"orgCountry":{"type":"string","nullable":true},"closures":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string","format":"date"},"label":{"type":"string","nullable":true}},"required":["id","date","label"]}},"observed":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"countryCode":{"type":"string"},"holidayId":{"type":"string"}},"required":["id","countryCode","holidayId"]}}},"required":["orgCountry","closures","observed"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/availability/closures":{"post":{"operationId":"postAvailabilityClosures","tags":["Disponibilités"],"summary":"Add a closure day","description":"One per date: an existing closure on that date is returned as is.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string"},"label":{"type":"string","minLength":1}},"required":["date","label"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"id":{"type":"string"}},"required":["ok","id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/availability/closures/{id}":{"delete":{"operationId":"deleteAvailabilityClosuresId","tags":["Disponibilités"],"summary":"Remove a closure day","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/availability/holiday-presets":{"get":{"operationId":"getAvailabilityHolidayPresets","tags":["Disponibilités"],"summary":"Bank holiday packs per country, with each holiday's next date","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"presets":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["presets"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/availability/observed-holidays":{"post":{"operationId":"postAvailabilityObservedHolidays","tags":["Disponibilités"],"summary":"Observe (or stop observing) one bank holiday","description":"Observing creates a yearly all-day blocked slot; stopping deletes it.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"countryCode":{"type":"string","minLength":2},"holidayId":{"type":"string","minLength":1},"observed":{"type":"boolean"}},"required":["countryCode","holidayId","observed"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/availability/observed-holidays/bulk":{"post":{"operationId":"postAvailabilityObservedHolidaysBulk","tags":["Disponibilités"],"summary":"Stop observing every holiday of a country","description":"`observed: true` changes nothing.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"countryCode":{"type":"string","minLength":2},"observed":{"type":"boolean"}},"required":["countryCode","observed"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/availability/resolve":{"get":{"operationId":"getAvailabilityResolve","tags":["Disponibilités"],"summary":"Effective working windows per member and day","description":"Plannings minus closures and holidays. Existing appointments are NOT subtracted: these are working hours, not free slots. A range longer than 62 days (from and to included) is a `400 range_too_long` with `details.maxDays`: split longer periods into several calls.","security":[{"apiKey":[]}],"parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"`YYYY-MM-DD`."},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"`YYYY-MM-DD`, not before `from`."},{"name":"memberId","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"memberId":{"type":"string"},"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"windows":{"type":"array","items":{"type":"object","additionalProperties":true}},"closed":{"type":"object","additionalProperties":true,"nullable":true}},"required":["date","windows","closed"]}}},"required":["memberId","days"]}},"closedDays":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["members","closedDays"]},"example":{"members":[{"memberId":"m1n4b7v0c3x6z9l2k5j8h1g4","days":[{"date":"2026-11-16","windows":[{"dow":1,"start":"08:00","end":"12:00"},{"dow":1,"start":"13:30","end":"17:30"}],"closed":null},{"date":"2026-11-17","windows":[],"closed":{"label":"Fermeture annuelle","kind":"closure"}}]}],"closedDays":[{"date":"2026-11-17","label":"Fermeture annuelle","kind":"closure"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/availability/schedules":{"get":{"operationId":"getAvailabilitySchedules","tags":["Disponibilités"],"summary":"List plannings (working hours per member)","description":"Switched-off plannings (`active: false`) are listed too: they are never offered for booking. `todo` lists what is left to complete on a planning (`zones`, `services`, `mode`, `step`, `limits`, `booking`, `address`, `other`), `[]` when nothing is; `todoNote` is a free note, or `null`.","security":[{"apiKey":[]}],"parameters":[{"name":"memberId","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postAvailabilitySchedules","tags":["Disponibilités"],"summary":"Create or update a planning","description":"Send `id` to update. A planning overlapping another of the same member is a `409 schedule_conflict` whose `details` name the clash. `active` defaults to `true`, on update too; a planning saved with `active: false` is not offered for booking and is not checked for overlaps until it is switched on again. `todo` (up to 8 distinct values) and `todoNote` (up to 300 characters) are `[]` and `null` when a planning is created without them, and left unchanged when an update leaves them out; `null` clears either.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"memberId":{"type":"string"},"name":{"type":"string","maxLength":200},"weeklyRules":{"type":"array","items":{"type":"object","properties":{"dow":{"type":"integer","minimum":0,"maximum":6},"start":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"end":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"gid":{"type":"string","maxLength":64},"zones":{"type":"array","items":{"type":"string"}},"services":{"type":"array","items":{"type":"string"}},"mode":{"type":"string","enum":["fixed","window"]},"step":{"type":"integer","minimum":5,"maximum":1440,"description":"Up to a full day: in arrival-window mode the step IS the window, and a plage may legitimately run 06:00–20:00 as one tranche."},"breakStart":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"breakEnd":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"limits":{"type":"object","properties":{"maxPerSlot":{"type":"integer","minimum":1,"maximum":24},"workloadMinutes":{"type":"integer","minimum":5,"maximum":720},"travelMinutes":{"type":"integer","minimum":0,"maximum":240},"distanceKm":{"type":"integer","minimum":0,"maximum":300}},"additionalProperties":false},"booking":{"type":"object","properties":{"leadMinutes":{"type":"integer","minimum":0,"maximum":4320},"horizonDays":{"type":"integer","minimum":1,"maximum":365},"cancelHours":{"type":"integer","minimum":0,"maximum":720},"breakAfterMinutes":{"type":"integer","minimum":0,"maximum":240},"breakBeyondHours":{"type":"boolean"},"bases":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","maxLength":300},"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180}},"required":["lat","lng"],"additionalProperties":false}},"travelFromBase":{"type":"boolean"},"travelToBase":{"type":"boolean"},"anchorMinutes":{"type":"integer","minimum":5,"maximum":240},"travelOrigin":{"type":"string","enum":["member","office","none"]},"autoOrganise":{"type":"boolean"}},"additionalProperties":false}},"required":["dow","start","end"],"additionalProperties":false}},"startsOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endsOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","nullable":true},"intervalWeeks":{"type":"integer","minimum":1,"maximum":4},"kind":{"type":"string","enum":["weekly","one_off","monthly_nth"]},"monthlyNth":{"type":"integer","minimum":1,"maximum":5},"active":{"type":"boolean"},"todo":{"type":"array","items":{"type":"string","enum":["zones","services","mode","step","limits","booking","address","other"]},"maxItems":8,"nullable":true},"todoNote":{"type":"string","maxLength":300,"nullable":true}},"required":["memberId","name","weeklyRules","startsOn"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"`schedule_conflict`: overlaps another planning of the same member; `details` name it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"schedule_conflict","message":"Schedule conflict","requestId":"5f0c2a9e-3b7d-4e61-9a24-8c1f0e6d7b52"}}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/availability/schedules/{id}":{"delete":{"operationId":"deleteAvailabilitySchedulesId","tags":["Disponibilités"],"summary":"Delete a planning","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/availability/week-templates":{"get":{"operationId":"getAvailabilityWeekTemplates","tags":["Disponibilités"],"summary":"List week templates","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"weeklyRules":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["id","name","weeklyRules"]}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postAvailabilityWeekTemplates","tags":["Disponibilités"],"summary":"Create or replace a week template","description":"Upsert by `id`; the 50 most recent are kept.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","maxLength":120,"minLength":1},"weeklyRules":{"type":"array","items":{"type":"object","properties":{"dow":{"type":"integer","minimum":0,"maximum":6},"start":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"end":{"type":"string","pattern":"^\\d{2}:\\d{2}$"}},"required":["dow","start","end"],"additionalProperties":false}}},"required":["name","weeklyRules"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"items":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["id","items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/availability/week-templates/{id}":{"delete":{"operationId":"deleteAvailabilityWeekTemplatesId","tags":["Disponibilités"],"summary":"Delete a week template","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"items":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["ok","items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/business-rules":{"get":{"operationId":"getBusinessRules","tags":["Configuration"],"summary":"Business rule definitions and their current values","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"rules":{"type":"array","items":{"type":"object","additionalProperties":true}},"values":{"type":"object","additionalProperties":true}},"required":["rules","values"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postBusinessRules","tags":["Configuration"],"summary":"Set one business rule","description":"Body `{ key, value }`; an unknown key is `400 unknown_rule`.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"value":{}},"required":["key"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/business-rules/service-dispatch/{serviceId}":{"patch":{"operationId":"patchBusinessRulesServiceDispatchServiceId","tags":["Configuration"],"summary":"Set how the slots of a service are found (smart dispatcher or open slots)","security":[{"apiKey":[]}],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["smart","open_slots"]}},"required":["mode"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/business-rules/service-overrides":{"get":{"operationId":"getBusinessRulesServiceOverrides","tags":["Configuration"],"summary":"Per-service booking overrides and online visibility","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/business-rules/service-overrides/{serviceId}":{"patch":{"operationId":"patchBusinessRulesServiceOverridesServiceId","tags":["Configuration"],"summary":"Set or clear one booking override of a service","security":[{"apiKey":[]}],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","enum":["leadTimeMinutes","maxAdvanceDays","cancellationHours","breakAfterMinutes"]},"value":{"type":"integer","minimum":0,"nullable":true}},"required":["key"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/business-rules/service-visibility/{serviceId}":{"patch":{"operationId":"patchBusinessRulesServiceVisibilityServiceId","tags":["Configuration"],"summary":"Set how a service is offered online (bookable, on request, visible, hidden)","security":[{"apiKey":[]}],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["bookable","request","visible","hidden"]},"message":{"type":"string","description":"Shown to clients when the mode is 'visible'.","nullable":true}},"required":["mode"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/calendar/bootstrap":{"get":{"operationId":"getCalendarBootstrap","tags":["Rendez-vous"],"summary":"Calendar events and reference data in one call","description":"The union of `/calendar/events` and `/calendar/refs`.","security":[{"apiKey":[]}],"parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarBootstrap"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/calendar/events":{"get":{"operationId":"getCalendarEvents","tags":["Rendez-vous"],"summary":"Calendar window: appointments, blocked slots, closed days and booking holds","description":"Everything overlapping `from`–`to` (default −90 / +180 days), `UNAVAILABILITY` rows included. The read model behind the dashboard calendar; for a sync prefer `GET /appointments`.","security":[{"apiKey":[]}],"parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"range":{"type":"object","additionalProperties":true},"closedDays":{"type":"array","items":{"type":"object","additionalProperties":true}},"holds":{"type":"array","items":{"type":"object","additionalProperties":true}},"appointments":{"type":"array","items":{"type":"object","additionalProperties":true}},"interventions":{"type":"object","additionalProperties":true},"clients":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/calendar/refs":{"get":{"operationId":"getCalendarRefs","tags":["Rendez-vous"],"summary":"Calendar reference data: services, clients (500 newest), locations, members, statuses","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"services":{"type":"array","items":{"type":"object","additionalProperties":true}},"clients":{"type":"array","items":{"type":"object","additionalProperties":true}},"locations":{"type":"array","items":{"type":"object","additionalProperties":true}},"members":{"type":"array","items":{"type":"object","additionalProperties":true}},"customStatuses":{"type":"array","items":{"type":"object","additionalProperties":true}},"format":{"type":"object","additionalProperties":true}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/categories":{"get":{"operationId":"getCatalogCategories","tags":["Catalogue"],"summary":"List service categories","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ServiceCategory"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postCatalogCategories","tags":["Catalogue"],"summary":"Create or update a category","description":"Upsert by `id`; `name` is required.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","nullable":true},"position":{"type":"integer"}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceCategory"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/categories/{id}":{"delete":{"operationId":"deleteCatalogCategoriesId","tags":["Catalogue"],"summary":"Hide a category","description":"Its services keep their `categoryId`.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/contract-templates":{"get":{"operationId":"getCatalogContractTemplates","tags":["Catalogue"],"summary":"List contract templates","description":"Newest first; deleted ones are left out.\n\nNeeds the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ContractTemplate"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postCatalogContractTemplates","tags":["Catalogue"],"summary":"Create or update a contract template","description":"Upsert by `id`; omitted fields return to their defaults. `totalAnnualCents` is in cents.\n\nNeeds the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"cadenceMonths":{"type":"integer","minimum":1},"noticeDays":{"type":"integer","minimum":0},"autoRenew":{"type":"boolean"},"totalAnnualCents":{"type":"integer","minimum":0,"nullable":true},"currency":{"type":"string"},"vatRate":{"type":"number","nullable":true},"bodyMarkdown":{"type":"string","nullable":true},"active":{"type":"boolean"}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractTemplate"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/contract-templates/{id}":{"delete":{"operationId":"deleteCatalogContractTemplatesId","tags":["Catalogue"],"summary":"Delete a contract template","description":"Existing contracts are kept.\n\nNeeds the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/library/services":{"get":{"operationId":"getCatalogLibraryServices","tags":["Catalogue"],"summary":"The shared service library any workspace can import from","description":"Prices here are cents (`priceCents`).","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/library/services/{id}/import":{"post":{"operationId":"postCatalogLibraryServicesIdImport","tags":["Catalogue"],"summary":"Import a library service into the workspace (created inactive)","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/locations":{"get":{"operationId":"getCatalogLocations","tags":["Catalogue"],"summary":"List locations (addresses, zones, online)","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Location"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postCatalogLocations","tags":["Catalogue"],"summary":"Create or update a location","description":"Upsert by `id`; `name` is required. On an update omitted address fields are cleared: send the whole location.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["FIXED","ZONE","VIRTUAL","PHONE"]},"line1":{"type":"string","nullable":true},"line2":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"postcode":{"type":"string","nullable":true},"region":{"type":"string","nullable":true},"country":{"type":"string"},"meetingUrl":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"color":{"type":"string","nullable":true},"active":{"type":"boolean"},"lat":{"type":"number","nullable":true},"lng":{"type":"number","nullable":true},"postcodes":{"type":"array","items":{"type":"string"}},"cities":{"type":"array","items":{"type":"string"}},"polygon":{"type":"object","additionalProperties":true,"description":"GeoJSON FeatureCollection: polygons, circles and rings.","nullable":true},"customFields":{"type":"object","additionalProperties":true,"nullable":true}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Location"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/locations/{id}":{"delete":{"operationId":"deleteCatalogLocationsId","tags":["Catalogue"],"summary":"Delete a location","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/promotions":{"get":{"operationId":"getCatalogPromotions","tags":["Catalogue"],"summary":"List promotions and discount codes","description":"Newest first.","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Promotion"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postCatalogPromotions","tags":["Catalogue"],"summary":"Create or update a promotion","description":"Upsert by `id`. `amountCents` is in cents.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"type":{"type":"string","enum":["PERCENT","FIXED_AMOUNT","PACKAGE","LOYALTY"]},"percent":{"type":"integer","minimum":0,"nullable":true},"amountCents":{"type":"integer","minimum":0,"nullable":true},"active":{"type":"boolean"}},"required":["name","type"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Promotion"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/promotions/{id}":{"delete":{"operationId":"deleteCatalogPromotionsId","tags":["Catalogue"],"summary":"Delete a promotion","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/questionnaires":{"get":{"operationId":"getCatalogQuestionnaires","tags":["Catalogue"],"summary":"List questionnaires with their questions and services","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"kind":{"type":"string"},"active":{"type":"boolean"},"fieldCount":{"type":"integer"},"fields":{"type":"array","items":{"type":"object","additionalProperties":true}},"serviceIds":{"type":"array","items":{"type":"string"}}},"required":["id","name","description","kind","active","fieldCount","fields","serviceIds"]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postCatalogQuestionnaires","tags":["Catalogue"],"summary":"Create or update a questionnaire","description":"Upsert by `id`. Omitted `fields` keep the questions; omitted `serviceIds` keep the links, `[]` removes them.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"kind":{"type":"string","enum":["INTAKE","SATISFACTION","TECHNICIAN_REPORT"]},"active":{"type":"boolean"},"fields":{"type":"array","items":{"type":"object","additionalProperties":true}},"serviceIds":{"type":"array","items":{"type":"string"}}},"required":["name","kind"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"The questionnaire row as saved. Its service links are not returned: read them with `GET /catalog/questionnaires`.","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"kind":{"type":"string","enum":["INTAKE","SATISFACTION","TECHNICIAN_REPORT"]},"schema":{"type":"object","additionalProperties":true,"description":"`{ fields: [...] }`: the questions."},"logic":{"description":"The branching rules, as stored (an array for a questionnaire created here)."},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/questionnaires/{id}":{"delete":{"operationId":"deleteCatalogQuestionnairesId","tags":["Catalogue"],"summary":"Delete a questionnaire","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/services":{"get":{"operationId":"getCatalogServices","tags":["Catalogue"],"summary":"List services, with category, variants and locations","description":"Not paginated. Archived services are left out (see `/catalog/services/archived`).","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Service"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postCatalogServices","tags":["Catalogue"],"summary":"Create or update a service","description":"Upsert by `id`. `name` and `durationMinutes` are required; `price` is in euros. On an update send the whole service: omitted `description`, `price`, `categoryId`, `color` are cleared. `locationIds`, when sent, replaces the links.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"durationMinutes":{"type":"integer","minimum":1},"price":{"type":"number","description":"Euros, as a number (`45.5`); `null` for no price. Read back as a decimal string.","nullable":true},"currency":{"type":"string","nullable":true},"categoryId":{"type":"string","nullable":true},"color":{"type":"string","nullable":true},"imageUrl":{"type":"string","description":"Data URL or stored URL — the catalogue list shows it as a thumbnail.","nullable":true},"pricing":{"type":"object","additionalProperties":true,"description":"Advanced pricing (base, tax-inclusive or not, unit price, distance surcharge), stored in `customFields.pricing` as sent.","nullable":true},"calendarCode":{"type":"string","maxLength":60,"description":"A short internal name shown in the calendar instead of the service name; never shown to customers. Omitted: kept; `null` or empty: cleared.","nullable":true},"clientInstructions":{"type":"string","maxLength":1000,"description":"What the customer should bring or prepare, included in booking messages. Omitted: kept; `null` or empty: cleared.","nullable":true},"active":{"type":"boolean"},"atClientSite":{"type":"boolean"},"locationIds":{"type":"array","items":{"type":"string"},"description":"The locations the service is offered at. Omitted: the links are kept; `[]` clears them."}},"required":["name","durationMinutes"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Service"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/services/{id}":{"delete":{"operationId":"deleteCatalogServicesId","tags":["Catalogue"],"summary":"Archive a service","description":"Restorable with `POST /catalog/services/{id}/restore`.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/services/{id}/calendar-code":{"patch":{"operationId":"patchCatalogServicesIdCalendarCode","tags":["Catalogue"],"summary":"Set or clear the short name a service shows in the calendar (24 characters)","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"calendarCode":{"type":"string","maxLength":60,"nullable":true}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"calendarCode":{"type":"string","nullable":true}},"required":["id","calendarCode"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/services/{id}/duplicate":{"post":{"operationId":"postCatalogServicesIdDuplicate","tags":["Catalogue"],"summary":"Copy a service with its variants, staff and locations","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":200}},"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/services/{id}/restore":{"post":{"operationId":"postCatalogServicesIdRestore","tags":["Catalogue"],"summary":"Restore an archived service (it comes back inactive)","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/services/{id}/variants":{"get":{"operationId":"getCatalogServicesIdVariants","tags":["Catalogue"],"summary":"List a service's variants (formules)","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ServiceVariant"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postCatalogServicesIdVariants","tags":["Catalogue"],"summary":"Create or update a variant","description":"Upsert by `id`; `name` and `durationMinutes` are required. On an update send the whole variant.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"durationMinutes":{"type":"integer","minimum":1},"price":{"type":"number","description":"Euros, as a number; `null`: the service's price applies. Read back as a decimal string.","nullable":true},"position":{"type":"integer"},"pricing":{"type":"object","additionalProperties":true,"description":"Advanced pricing for this variant — the same shape as the service's `pricing`.","nullable":true},"active":{"type":"boolean"}},"required":["name","durationMinutes"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceVariant"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/services/archived":{"get":{"operationId":"getCatalogServicesArchived","tags":["Catalogue"],"summary":"List archived services","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Service"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/services/reorder":{"post":{"operationId":"postCatalogServicesReorder","tags":["Catalogue"],"summary":"Save the order of services","description":"Body `{ ids: [...] }`; each index becomes the position.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"description":"Service ids in their new order — index becomes `position`."}},"required":["ids"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/specialties":{"get":{"operationId":"getCatalogSpecialties","tags":["Catalogue"],"summary":"Who can perform each service: members, teams, crew size, named crews","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"serviceId":{"type":"string"},"serviceName":{"type":"string"},"memberIds":{"type":"array","items":{"type":"string"}},"teamIds":{"type":"array","items":{"type":"string"}},"crewSize":{"type":"integer"},"crews":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"memberIds":{"type":"array","items":{"type":"string"}}},"required":["id","name","memberIds"]}}},"required":["serviceId","serviceName","memberIds","teamIds","crewSize","crews"]}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/specialties/{serviceId}":{"post":{"operationId":"postCatalogSpecialtiesServiceId","tags":["Catalogue"],"summary":"Set who can perform a service","description":"`memberIds` replaces the list; `teamIds` and `crewSize` change only when sent.","security":[{"apiKey":[]}],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"memberIds":{"type":"array","items":{"type":"string"}},"teamIds":{"type":"array","items":{"type":"string"},"description":"Workspace teams qualified for the service."},"crewSize":{"type":"integer","minimum":1,"maximum":50,"description":"How many people the job goes out with."}},"required":["memberIds"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/specialties/{serviceId}/crews":{"post":{"operationId":"postCatalogSpecialtiesServiceIdCrews","tags":["Catalogue"],"summary":"Create or rename a named crew for a service","security":[{"apiKey":[]}],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Omitted creates; present renames/recomposes."},"name":{"type":"string"},"memberIds":{"type":"array","items":{"type":"string"}}},"required":["name","memberIds"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/specialties/{serviceId}/crews/{crewId}":{"delete":{"operationId":"deleteCatalogSpecialtiesServiceIdCrewsCrewId","tags":["Catalogue"],"summary":"Delete a crew","security":[{"apiKey":[]}],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"crewId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/catalog/variants/{variantId}":{"delete":{"operationId":"deleteCatalogVariantsVariantId","tags":["Catalogue"],"summary":"Delete a variant","security":[{"apiKey":[]}],"parameters":[{"name":"variantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/clients":{"get":{"operationId":"getClients","tags":["Contacts"],"summary":"List contacts (people, companies, or both)","description":"Without `kind`, only people (`INDIVIDUAL`) are returned — send `kind=ALL` for people and companies, `kind=COMPANY` for companies. `search` matches name, email and phone, and the account's contacts.","security":[{"apiKey":[]}],"parameters":[{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["INDIVIDUAL","COMPANY","ALL"]},"description":"`INDIVIDUAL` (default), `COMPANY`, or `ALL` for both."},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["CLIENT","SUPPLIER","PARTNER"]},"description":"Companies with this relationship: `CLIENT`, `SUPPLIER` or `PARTNER`."},{"name":"specialty","in":"query","required":false,"schema":{"type":"string","maxLength":60},"description":"Companies with this specialty code (see `GET /crm/specialties`)."},{"name":"companyId","in":"query","required":false,"schema":{"type":"string"},"description":"The people attached to one company."},{"name":"listId","in":"query","required":false,"schema":{"type":"string","maxLength":64},"description":"The records an imported or hosted list brought in (see `/companies/lists`)."},{"name":"view","in":"query","required":false,"schema":{"type":"string","enum":["list"]},"description":"`list` returns only the columns a table row needs — a much smaller payload."},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["name","recent"]},"description":"`name` (default) or `recent` — newest first. Applied before paging, over the whole workspace."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Default 50; a larger value is lowered to 100."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0},"description":"Rows to skip."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"Page size 50 by default, 100 at most; `limit` and `offset` are echoed back.","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Client"}},"total":{"type":"integer","description":"Rows matching the filter, ignoring paging."},"limit":{"type":"integer"},"offset":{"type":"integer"}},"required":["items","total","limit","offset"]},"example":{"items":[{"id":"k7m2x9q4w1e8r5t3y6u0i2o4","kind":"INDIVIDUAL","types":["CLIENT"],"firstName":"Camille","lastName":"Durand","fullName":"Camille Durand","email":"camille.durand@example.com","phone":"+33612345678","companyId":"c3v8b1n6m4q9w2e7r5t0y8u1","siret":null,"vatNumber":null,"trade":null,"website":null,"language":"fr","birthdate":null,"notes":"Portail côté jardin, sonner deux fois.","tags":["chaudière","contrat-entretien"],"specialties":[],"address":{"line1":"12 rue des Lilas","city":"Nantes","postalCode":"44000","country":"FR","lat":47.2184,"lng":-1.5536},"customFields":{"numero_client_erp":"C-10482"},"primaryContact":null,"mergedIntoId":null,"contactCount":0,"siteCount":1,"noShowCount":0,"cancellationCount":0,"ltvCents":48000,"createdAt":"2026-09-14T08:12:44.000Z","updatedAt":"2026-11-03T16:40:02.000Z"}],"total":1,"limit":50,"offset":0}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postClients","tags":["Contacts"],"summary":"Create or update a contact","description":"Upsert by IWANA `id` only: without `id` this ALWAYS creates — it never matches an existing contact by email, phone or name. An unknown `id` is a `404`. To avoid duplicates, keep your id ↔ IWANA id mapping with `PUT /external-refs` and look it up with `GET /external-refs` first. A person needs `firstName` or `lastName`; a company (`kind=COMPANY`) needs `name`. On an update omitted fields are kept, except that a person's `firstName` and `lastName` are rebuilt from the body together: send both. `customFields`, when sent, replaces the stored object. `kind` counts at creation only (use `/clients/{id}/convert`). A company SIRET already used is a `409 siret_already_used`. Emits `client.created` or `client.updated`.\n\nSend `Idempotency-Key` to make a retry safe: the same key within 48 h replays the first response.","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["INDIVIDUAL","COMPANY"],"description":"`INDIVIDUAL` (default) or `COMPANY`. Read at creation only: change it later with `POST /clients/{id}/convert`."},"name":{"type":"string","maxLength":200,"description":"A company's legal name (`kind=COMPANY`); required for a company.","nullable":true},"types":{"type":"array","items":{"type":"string","enum":["CLIENT","SUPPLIER","PARTNER"]}},"specialties":{"type":"array","items":{"type":"string","maxLength":60},"description":"Specialty codes of a company (see `GET /crm/specialties`); an unknown code is ignored."},"website":{"type":"string","maxLength":300,"nullable":true},"trade":{"type":"string","maxLength":120,"nullable":true},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"companyId":{"type":"string","description":"The company this person belongs to; `null` for none.","nullable":true},"siret":{"type":"string","nullable":true},"vatNumber":{"type":"string","nullable":true},"address":{"type":"object","additionalProperties":true,"nullable":true},"language":{"type":"string","nullable":true},"birthdate":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"customFields":{"type":"object","additionalProperties":true}},"additionalProperties":false},"example":{"kind":"INDIVIDUAL","firstName":"Camille","lastName":"Durand","email":"camille.durand@example.com","phone":"+33612345678","address":{"line1":"12 rue des Lilas","city":"Nantes","postalCode":"44000","country":"FR"},"tags":["chaudière"],"customFields":{"numero_client_erp":"C-10482"}}}}},"responses":{"201":{"description":"Created or updated (201 in both cases).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Client"},"example":{"id":"k7m2x9q4w1e8r5t3y6u0i2o4","kind":"INDIVIDUAL","types":["CLIENT"],"firstName":"Camille","lastName":"Durand","fullName":"Camille Durand","email":"camille.durand@example.com","phone":"+33612345678","companyId":"c3v8b1n6m4q9w2e7r5t0y8u1","siret":null,"vatNumber":null,"trade":null,"website":null,"language":"fr","birthdate":null,"notes":"Portail côté jardin, sonner deux fois.","tags":["chaudière","contrat-entretien"],"specialties":[],"address":{"line1":"12 rue des Lilas","city":"Nantes","postalCode":"44000","country":"FR","lat":47.2184,"lng":-1.5536},"customFields":{"numero_client_erp":"C-10482"},"primaryContact":null,"mergedIntoId":null,"contactCount":0,"siteCount":1,"noShowCount":0,"cancellationCount":0,"ltvCents":48000,"createdAt":"2026-09-14T08:12:44.000Z","updatedAt":"2026-11-03T16:40:02.000Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"`siret_already_used`: another record of the workspace has this SIRET; `details.clientId` names it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"siret_already_used","message":"Siret already used","requestId":"5f0c2a9e-3b7d-4e61-9a24-8c1f0e6d7b52"}}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/clients/{id}":{"delete":{"operationId":"deleteClientsId","tags":["Contacts"],"summary":"Delete a contact","description":"Soft delete: the contact leaves lists and `GET` answers 404.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"get":{"operationId":"getClientsId","tags":["Contacts"],"summary":"Get one contact, with contact and site counts","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientDetail"},"example":{"id":"k7m2x9q4w1e8r5t3y6u0i2o4","kind":"INDIVIDUAL","types":["CLIENT"],"firstName":"Camille","lastName":"Durand","fullName":"Camille Durand","email":"camille.durand@example.com","phone":"+33612345678","companyId":"c3v8b1n6m4q9w2e7r5t0y8u1","siret":null,"vatNumber":null,"trade":null,"website":null,"language":"fr","birthdate":null,"notes":"Portail côté jardin, sonner deux fois.","tags":["chaudière","contrat-entretien"],"specialties":[],"address":{"line1":"12 rue des Lilas","city":"Nantes","postalCode":"44000","country":"FR","lat":47.2184,"lng":-1.5536},"customFields":{"numero_client_erp":"C-10482"},"primaryContact":null,"mergedIntoId":null,"contactCount":0,"siteCount":1,"noShowCount":0,"cancellationCount":0,"ltvCents":48000,"createdAt":"2026-09-14T08:12:44.000Z","updatedAt":"2026-11-03T16:40:02.000Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/clients/{id}/communications":{"get":{"operationId":"getClientsIdCommunications","tags":["Contacts"],"summary":"The 100 newest sends to this contact","description":"For a company, its persons too. `excerpt` in place of the body; 404 outside the workspace.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/clients/{id}/convert":{"post":{"operationId":"postClientsIdConvert","tags":["Contacts"],"summary":"Turn a person into a company or back, keeping the id and every linked record","description":"A company that still has contacts cannot become a person (`409 company_has_contacts`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["INDIVIDUAL","COMPANY"]},"name":{"type":"string","maxLength":200},"types":{"type":"array","items":{"type":"string","enum":["CLIENT","SUPPLIER","PARTNER"]}}},"required":["kind"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Client"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"`company_has_contacts` (a company with people cannot become a person; `details.contacts`), or `siret_already_used` (`details.clientId`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"company_has_contacts","message":"Company has contacts","requestId":"5f0c2a9e-3b7d-4e61-9a24-8c1f0e6d7b52"}}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/clients/{id}/documents":{"get":{"operationId":"getClientsIdDocuments","tags":["Contacts"],"summary":"List a contact's documents, newest first","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100},"description":"1–100; a larger value is lowered to 100. Without it (or with a value that is not a positive integer) the whole list comes back."},{"name":"before","in":"query","required":false,"schema":{"type":"string"},"description":"Cursor: the `nextBefore` of the previous page."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Document"}},"nextBefore":{"type":"string","description":"Pass as `before` for the next page; absent when `limit` was not sent.","nullable":true}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postClientsIdDocuments","tags":["Contacts"],"summary":"Upload a document to a contact","description":"Body `{ filename, mimeType, dataUrl }` with a base64 data URL, 14 MB at most.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","maxLength":255},"mimeType":{"type":"string","maxLength":160},"dataUrl":{"type":"string","maxLength":20000000,"description":"`data:<mime>;base64,<payload>`. Capped below the body limit so an oversized file fails validation rather than being truncated by the parser."}},"required":["filename","mimeType","dataUrl"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"document":{"$ref":"#/components/schemas/Document"}},"required":["document"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/clients/{id}/duplicates":{"get":{"operationId":"getClientsIdDuplicates","tags":["Contacts"],"summary":"Possible duplicates of a contact (same SIRET or same folded name)","description":"At most 20. Read-only: merge with `POST /clients/{id}/merge`.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"fullName":{"type":"string"},"kind":{"type":"string"},"siret":{"type":"string","nullable":true},"reasons":{"type":"array","items":{"type":"string","enum":["SIRET","NAME"]}}},"required":["id","fullName","kind","siret","reasons"]}},"suggestConvert":{"type":"object","additionalProperties":true,"nullable":true}},"required":["items","suggestConvert"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/clients/{id}/merge":{"post":{"operationId":"postClientsIdMerge","tags":["Contacts"],"summary":"Merge this duplicate into targetId","description":"Moves every reference (appointments, sites, quotes…) to the target in one transaction, fills the target's empty fields and soft-deletes this contact with `mergedIntoId`. Emits `client.updated` for the target.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"targetId":{"type":"string","maxLength":64}},"required":["targetId"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"sourceId":{"type":"string"},"targetId":{"type":"string"},"moved":{"type":"object","additionalProperties":{"type":"integer"}}},"required":["sourceId","targetId","moved"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/clients/{id}/portal-link":{"delete":{"operationId":"deleteClientsIdPortalLink","tags":["Contacts"],"summary":"Revoke the contact's portal link","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postClientsIdPortalLink","tags":["Contacts"],"summary":"Get the contact's customer-portal link (created once, then reused)","description":"Sends nothing: share the URL yourself.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"url":{"type":"string"}},"required":["token","url"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/clients/{id}/summary":{"get":{"operationId":"getClientsIdSummary","tags":["Contacts"],"summary":"A contact's history at a glance: counts and the latest records of each kind","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"counts":{"type":"object","additionalProperties":true},"satisfaction":{"type":"object","additionalProperties":true,"nullable":true},"quotes":{"type":"array","items":{"type":"object","additionalProperties":true}},"invoices":{"type":"array","items":{"type":"object","additionalProperties":true}},"contracts":{"type":"array","items":{"type":"object","additionalProperties":true}},"projects":{"type":"array","items":{"type":"object","additionalProperties":true}},"equipments":{"type":"array","items":{"type":"object","additionalProperties":true}},"appointments":{"type":"object","properties":{"upcoming":{"type":"array","items":{"type":"object","additionalProperties":true}},"past":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["upcoming","past"]},"interventions":{"type":"array","items":{"type":"object","additionalProperties":true}},"communications":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/clients/documents/{documentId}":{"delete":{"operationId":"deleteClientsDocumentsDocumentId","tags":["Contacts"],"summary":"Delete a contact document and its file","security":[{"apiKey":[]}],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/clients/documents/{documentId}/content":{"get":{"operationId":"getClientsDocumentsDocumentIdContent","tags":["Contacts"],"summary":"Download a contact document","security":[{"apiKey":[]}],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The file's bytes, with its own `Content-Type`.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/clients/documents/{documentId}/refresh-url":{"post":{"operationId":"postClientsDocumentsDocumentIdRefreshUrl","tags":["Contacts"],"summary":"Get a fresh download URL for a document","security":[{"apiKey":[]}],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"url":{"type":"string"}},"required":["ok","url"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/clients/import":{"post":{"operationId":"postClientsImport","tags":["Contacts"],"summary":"Bulk import contacts (up to 20 000 rows)","description":"Without `target`: legacy mode — rows whose email already exists are skipped. With `target`: the guided import, which matches rows on email, phone, SIRET or name and applies `duplicates` (`skip`, `update` or `create`) in one transaction. No webhooks are emitted for imported rows.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"additionalEmails":{"type":"array","items":{"type":"string"}},"phone":{"type":"string","nullable":true},"address":{"type":"object","additionalProperties":true,"nullable":true},"birthdate":{"type":"string","nullable":true},"language":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"notes":{"type":"string","nullable":true},"customFields":{"type":"object","additionalProperties":true},"company":{"type":"string","nullable":true},"siret":{"type":"string","nullable":true},"civility":{"type":"string","maxLength":40,"nullable":true},"mobile":{"type":"string","maxLength":60,"nullable":true},"jobTitle":{"type":"string","maxLength":200,"nullable":true},"vatNumber":{"type":"string","maxLength":40,"nullable":true},"website":{"type":"string","maxLength":500,"nullable":true},"kind":{"type":"string","enum":["INDIVIDUAL","COMPANY"]}},"additionalProperties":false},"maxItems":20000},"target":{"type":"string","enum":["INDIVIDUAL","COMPANY","CONTACT"]},"duplicates":{"type":"string","enum":["skip","update","create"]},"createCompanies":{"type":"boolean"},"siteLabel":{"type":"string","maxLength":120},"mobileLabel":{"type":"string","maxLength":60},"geocode":{"type":"boolean"}},"required":["rows"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"inserted":{"type":"integer"},"created":{"type":"integer"},"updated":{"type":"integer"},"skipped":{"type":"integer"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}},"companiesCreated":{"type":"integer"},"contactsCreated":{"type":"integer"},"sitesCreated":{"type":"integer"},"outcomes":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/clients/import/check":{"post":{"operationId":"postClientsImportCheck","tags":["Contacts"],"summary":"Preview a guided import: which rows match an existing record","description":"Read-only, so it answers `200`.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"additionalEmails":{"type":"array","items":{"type":"string"}},"phone":{"type":"string","nullable":true},"address":{"type":"object","additionalProperties":true,"nullable":true},"birthdate":{"type":"string","nullable":true},"language":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"notes":{"type":"string","nullable":true},"customFields":{"type":"object","additionalProperties":true},"company":{"type":"string","nullable":true},"siret":{"type":"string","nullable":true},"civility":{"type":"string","maxLength":40,"nullable":true},"mobile":{"type":"string","maxLength":60,"nullable":true},"jobTitle":{"type":"string","maxLength":200,"nullable":true},"vatNumber":{"type":"string","maxLength":40,"nullable":true},"website":{"type":"string","maxLength":500,"nullable":true},"kind":{"type":"string","enum":["INDIVIDUAL","COMPANY"]}},"additionalProperties":false},"maxItems":20000},"target":{"type":"string","enum":["INDIVIDUAL","COMPANY","CONTACT"]}},"required":["rows","target"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"matches":{"type":"array","items":{"type":"object","additionalProperties":true}},"companies":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/bootstrap":{"get":{"operationId":"getCommunicationsBootstrap","tags":["Communications"],"summary":"The 50 latest sends, templates, campaigns and sender identity","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommunicationsBootstrap"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/export":{"get":{"operationId":"getCommunicationsExport","tags":["Communications"],"summary":"The whole send journal with its texts (GDPR export)","description":"Every journal column plus `body`, oldest first.","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/history":{"get":{"operationId":"getCommunicationsHistory","tags":["Communications"],"summary":"The send history, one page at a time, newest first","description":"`?cursor=` is the `historyNextCursor` of the bootstrap or the `nextCursor` of the previous page; without it, the first page (the 50 newest). Answers `{ history, nextCursor }`, `nextCursor: null` on the last page.","security":[{"apiKey":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"history":{"type":"array","items":{"type":"object","additionalProperties":true}},"nextCursor":{"type":"string","nullable":true}},"required":["history","nextCursor"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/history/{id}":{"get":{"operationId":"getCommunicationsHistoryId","tags":["Communications"],"summary":"One sent message in full, with delivery dates","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"channel":{"type":"string","enum":["EMAIL","SMS","WHATSAPP","PUSH","IN_APP","VOICE"]},"type":{"type":"string","description":"Which letter it was, by its Notifications name."},"subject":{"type":"string","nullable":true},"body":{"type":"string","description":"What left: HTML for an email, text for an SMS.","nullable":true},"bodyHtml":{"type":"string","description":"The email as the recipient saw it; `null` for an SMS or an empty body.","nullable":true},"templateId":{"type":"string","nullable":true},"toEmail":{"type":"string","nullable":true},"toPhone":{"type":"string","nullable":true},"fromName":{"type":"string","nullable":true},"fromEmail":{"type":"string","nullable":true},"smsSender":{"type":"string","description":"The sender name the phone showed; `null` unless an SMS.","nullable":true},"clientId":{"type":"string","nullable":true},"appointmentId":{"type":"string","nullable":true},"status":{"type":"string","enum":["QUEUED","SENT","DELIVERED","OPENED","CLICKED","FAILED","BOUNCED","COMPLAINED","SUPPRESSED"]},"providerId":{"type":"string","nullable":true},"providerMessageId":{"type":"string","nullable":true},"failureReason":{"type":"string","nullable":true},"sentAt":{"type":"string","format":"date-time","nullable":true},"deliveredAt":{"type":"string","format":"date-time","nullable":true},"openedAt":{"type":"string","format":"date-time","nullable":true},"clickedAt":{"type":"string","format":"date-time","nullable":true},"failedAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","channel","type","subject","body","bodyHtml","templateId","toEmail","toPhone","fromName","fromEmail","smsSender","clientId","appointmentId","status","providerId","providerMessageId","failureReason","sentAt","deliveredAt","openedAt","clickedAt","failedAt","createdAt"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/media/attachment":{"post":{"operationId":"postCommunicationsMediaAttachment","tags":["Communications"],"summary":"Store an email attachment and get its reference","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dataUrl":{"type":"string","maxLength":14500000},"name":{"type":"string","maxLength":200}},"required":["dataUrl","name"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"ref":{"type":"string"},"size":{"type":"integer"}},"required":["name","ref","size"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/media/image":{"post":{"operationId":"postCommunicationsMediaImage","tags":["Communications"],"summary":"Publish an image for emails and get its public URL","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dataUrl":{"type":"string","maxLength":7500000},"variantOf":{"type":"string","maxLength":500},"ratio":{"type":"string","enum":["16:9","4:3","3:2","1:1"]}},"required":["dataUrl"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/notifications":{"get":{"operationId":"getCommunicationsNotifications","tags":["Communications"],"summary":"The notification letters the workspace sends, with on/off state and wording","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationSettings"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/notifications/{id}":{"patch":{"operationId":"patchCommunicationsNotificationsId","tags":["Communications"],"summary":"Switch one notification letter on or off","description":"Turns the matching automation step on or off.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/notifications/{id}/letter":{"delete":{"operationId":"deleteCommunicationsNotificationsIdLetter","tags":["Communications"],"summary":"Go back to the platform wording for a letter","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"put":{"operationId":"putCommunicationsNotificationsIdLetter","tags":["Communications"],"summary":"Save the workspace's own wording for a letter","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string","maxLength":300},"body":{"type":"string","maxLength":20000}},"required":["body"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/notifications/{id}/test":{"post":{"operationId":"postCommunicationsNotificationsIdTest","tags":["Communications"],"summary":"Send a test of one letter, filled with sample data","description":"A real message marked \"[Test]\". Send `to`: a key has no account email to fall back on, and an SMS test always needs it (and is billed).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string","maxLength":300},"body":{"type":"string","maxLength":20000},"branding":{"type":"string","enum":["PLATFORM","CUSTOM"],"description":"The shell the preview showed — the test wears the same one."},"proNote":{"type":"string","maxLength":4000},"to":{"type":"string","maxLength":200,"description":"Where the test goes: an e-mail address, or a mobile number for an SMS. Empty e-mail = the account's own address."}},"required":["body"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"to":{"type":"string"}},"required":["ok","to"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/notifications/brand":{"patch":{"operationId":"patchCommunicationsNotificationsBrand","tags":["Communications"],"summary":"Set the email brand (mode, display name, colour)","security":[{"apiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["custom","platform"]},"name":{"type":"string","maxLength":80,"nullable":true},"color":{"type":"string","nullable":true}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/notifications/custom":{"post":{"operationId":"postCommunicationsNotificationsCustom","tags":["Communications"],"summary":"Create a custom letter","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":120},"channel":{"type":"string","enum":["EMAIL","SMS"]}},"required":["name","channel"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/notifications/custom/{id}":{"delete":{"operationId":"deleteCommunicationsNotificationsCustomId","tags":["Communications"],"summary":"Delete a custom letter","description":"Automations still using it will fail to send.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"patchCommunicationsNotificationsCustomId","tags":["Communications"],"summary":"Rename a custom letter","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":120}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/notifications/letters":{"get":{"operationId":"getCommunicationsNotificationsLetters","tags":["Communications"],"summary":"The letters an automation can send","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"letters":{"type":"array","items":{"type":"object","additionalProperties":true}},"others":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["letters","others"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/notifications/notes":{"put":{"operationId":"putCommunicationsNotificationsNotes","tags":["Communications"],"summary":"Replace the per-service notes added to letters","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"notes":{"type":"array","items":{},"maxItems":20}},"required":["notes"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"notes":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["ok","notes"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/notifications/test":{"post":{"operationId":"postCommunicationsNotificationsTest","tags":["Communications"],"summary":"Send a test of any message text","description":"Like the letter test, with `channel` (`EMAIL` or `SMS`). Send `to`.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string","maxLength":300},"body":{"type":"string","maxLength":20000},"branding":{"type":"string","enum":["PLATFORM","CUSTOM"],"description":"The shell the preview showed — the test wears the same one."},"proNote":{"type":"string","maxLength":4000},"to":{"type":"string","maxLength":200,"description":"Where the test goes: an e-mail address, or a mobile number for an SMS. Empty e-mail = the account's own address."},"channel":{"type":"string","enum":["EMAIL","SMS"]}},"required":["body","channel"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"to":{"type":"string"}},"required":["ok","to"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/presets":{"get":{"operationId":"getCommunicationsPresets","tags":["Communications"],"summary":"The platform's message presets","description":"Letters to clients only.","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"channel":{"type":"string","enum":["EMAIL","SMS","WHATSAPP"]},"contextType":{"type":"string"},"category":{"type":"string","nullable":true},"language":{"type":"string","nullable":true},"audience":{"type":"string","enum":["CLIENT"]},"subject":{"type":"string","nullable":true},"body":{"type":"string"},"position":{"type":"integer"}},"required":["slug","name","description","channel","contextType","category","language","audience","subject","body","position"]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/preview":{"post":{"operationId":"postCommunicationsPreview","tags":["Communications"],"summary":"Render a message in the real email layout (nothing is sent)","description":"Saves and sends nothing, so it answers `200`.","security":[{"apiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string","maxLength":300},"body":{"type":"string","maxLength":20000},"branding":{"type":"string","enum":["PLATFORM","CUSTOM"],"description":"Whose letterhead — decides the shell, exactly as it will at send time."},"lang":{"type":"string","maxLength":8,"description":"Language of the mail — picks the recap card's title and formats the sample values."},"sample":{"type":"boolean","description":"Replace the `{{variables}}` with realistic values before rendering."},"platform":{"type":"boolean","description":"A collaborative-project letter: IWANA's brand whatever the workspace mode."},"highlight":{"type":"boolean","description":"With `sample`: mark every inserted value (teal tint) so the reader sees what the sender fills."},"sms":{"type":"string","maxLength":2000,"description":"An SMS to fill the same way — answered as `smsParts`."},"proNote":{"type":"string","maxLength":4000}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"html":{"type":"string","description":"The whole email document."},"subjectParts":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"variable":{"type":"boolean","description":"Whether this piece is a filled-in variable."}},"required":["text","variable"]}},"to":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"variable":{"type":"boolean","description":"Whether this piece is a filled-in variable."}},"required":["text","variable"]},"description":"The sample recipient; `null` without `sample`.","nullable":true},"smsParts":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"variable":{"type":"boolean","description":"Whether this piece is a filled-in variable."}},"required":["text","variable"]},"description":"`null` unless `sms` was sent.","nullable":true},"sampleVars":{"type":"object","additionalProperties":{"type":"string"},"description":"Variable → sample value; `null` without `sample`.","nullable":true},"platform":{"type":"boolean","description":"Whether the workspace sends under the IWANA brand."}},"required":["html","subjectParts","to","smsParts","sampleVars","platform"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/sender-identity":{"patch":{"operationId":"patchCommunicationsSenderIdentity","tags":["Communications"],"summary":"Set the sender email and/or request an SMS sender name","description":"An SMS sender name is reviewed by IWANA; messages go out under the current one until it is approved.","security":[{"apiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"senderEmail":{"type":"string","nullable":true},"smsSenderId":{"type":"string","nullable":true}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/sms-sender":{"get":{"operationId":"getCommunicationsSmsSender","tags":["Communications"],"summary":"The requested and active SMS sender names","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"requested":{"type":"string","nullable":true},"active":{"type":"string","nullable":true},"state":{"type":"string","enum":["none","pending","approved","rejected"]},"rejectReason":{"type":"string","nullable":true},"requestedAt":{"type":"string","format":"date-time","nullable":true}},"required":["requested","active","state","rejectReason","requestedAt"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/sms-sender/request":{"delete":{"operationId":"deleteCommunicationsSmsSenderRequest","tags":["Communications"],"summary":"Withdraw the pending SMS sender request","description":"The requested name goes back to the last approved one (or the default). `404` when nothing is pending. Answers the new state, as `GET /communications/sms-sender` does.","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"requested":{"type":"string","nullable":true},"active":{"type":"string","nullable":true},"state":{"type":"string","enum":["none","pending","approved","rejected"]},"rejectReason":{"type":"string","nullable":true},"requestedAt":{"type":"string","format":"date-time","nullable":true}},"required":["requested","active","state","rejectReason","requestedAt"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/communications/templates/{id}":{"get":{"operationId":"getCommunicationsTemplatesId","tags":["Communications"],"summary":"One message template with its current wording","description":"A locked template (IWANA's own wording) shows the platform's current text.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"internalDescription":{"type":"string","nullable":true},"channel":{"type":"string","enum":["EMAIL","SMS","WHATSAPP","PUSH","IN_APP","VOICE"]},"contextType":{"type":"string"},"category":{"type":"string","nullable":true},"language":{"type":"string","nullable":true},"status":{"type":"string","enum":["DRAFT","ACTIVE","ARCHIVED"]},"branding":{"type":"string","enum":["PLATFORM","CUSTOM"]},"sourcePresetSlug":{"type":"string","nullable":true},"locked":{"type":"boolean","description":"IWANA's own wording: read-only."},"subject":{"type":"string","nullable":true},"body":{"type":"string"},"richBody":{"type":"string","nullable":true}},"required":["id","name","internalDescription","channel","contextType","category","language","status","branding","sourcePresetSlug","locked","subject","body","richBody"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/companies":{"get":{"operationId":"getCompanies","tags":["Contacts"],"summary":"List companies","description":"The `kind=COMPANY` contacts, in the company layout.","security":[{"apiKey":[]}],"parameters":[{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"listId","in":"query","required":false,"schema":{"type":"string"},"description":"The companies one list brought in."},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["CLIENT","SUPPLIER","PARTNER"]},"description":"`CLIENT`, `SUPPLIER` or `PARTNER`."},{"name":"specialty","in":"query","required":false,"schema":{"type":"string","maxLength":60},"description":"A specialty code (see `GET /crm/specialties`)."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"description":"Default 50; a larger value is lowered to 200."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"Page size 50 by default, 200 at most.","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Company"}},"total":{"type":"integer","description":"Rows matching the filter, ignoring paging."}},"required":["items","total"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postCompanies","tags":["Contacts"],"summary":"Create or update a company","description":"Upsert by `id` only; `name` is required. On an update the body replaces `types`, `tags` and the contact fields (an omitted one is cleared), `specialties` is kept when omitted. A SIRET already used by another record is a `409 siret_already_used`, as on `POST /clients`.\n\nSend `Idempotency-Key` to make a retry safe: the same key within 48 h replays the first response.","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","maxLength":200,"minLength":1},"types":{"type":"array","items":{"type":"string","enum":["CLIENT","SUPPLIER","PARTNER"]}},"trade":{"type":"string","maxLength":120,"nullable":true},"specialties":{"type":"array","items":{"type":"string","maxLength":60},"description":"Specialty codes (see `GET /crm/specialties`). Omitted: kept."},"siret":{"type":"string","maxLength":20,"nullable":true},"vatNumber":{"type":"string","maxLength":30,"nullable":true},"email":{"type":"string","maxLength":200,"nullable":true},"phone":{"type":"string","maxLength":40,"nullable":true},"website":{"type":"string","maxLength":300,"nullable":true},"address":{"type":"string","maxLength":300,"nullable":true},"postcode":{"type":"string","maxLength":20,"nullable":true},"city":{"type":"string","maxLength":120,"nullable":true},"lat":{"type":"number","minimum":-90,"maximum":90,"description":"Decimal degrees.","nullable":true},"lng":{"type":"number","minimum":-180,"maximum":180,"description":"Decimal degrees.","nullable":true},"notes":{"type":"string","maxLength":4000,"nullable":true},"tags":{"type":"array","items":{"type":"string"}}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Company"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"`siret_already_used`: another record of the workspace has this SIRET; `details.clientId` names it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"siret_already_used","message":"Siret already used","requestId":"5f0c2a9e-3b7d-4e61-9a24-8c1f0e6d7b52"}}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/companies/{id}":{"delete":{"operationId":"deleteCompaniesId","tags":["Contacts"],"summary":"Delete a company","description":"Soft delete; its people stay, detached.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","deleted"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"get":{"operationId":"getCompaniesId","tags":["Contacts"],"summary":"Get one company with its people","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Company"},{"type":"object","properties":{"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"fullName":{"type":"string"},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true}},"required":["id","fullName","email","phone"]}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/companies/{id}/contacts":{"post":{"operationId":"postCompaniesIdContacts","tags":["Contacts"],"summary":"Attach an existing person (kind=INDIVIDUAL contact) to the company","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"attached":{"type":"boolean"}},"required":["id","clientId","attached"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/companies/{id}/contacts/{clientId}":{"delete":{"operationId":"deleteCompaniesIdContactsClientId","tags":["Contacts"],"summary":"Detach a person from the company","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"clientId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"attached":{"type":"boolean"}},"required":["id","clientId","attached"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/companies/lists":{"get":{"operationId":"getCompaniesLists","tags":["Contacts"],"summary":"List company and contact lists (imported or hosted files)","description":"Credentials are never returned.","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CompanyList"}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postCompaniesLists","tags":["Contacts"],"summary":"Create or update a list, optionally backed by a hosted file","description":"Upsert by `id`. A new `CONTACT` list needs `companyId`. A new hosted list is fetched at once.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","maxLength":120,"minLength":1},"kind":{"type":"string","enum":["COMPANY","CONTACT"]},"companyId":{"type":"string","maxLength":64,"description":"For a `CONTACT` list: the company every row becomes a person of. Required at creation; omitted on an update: unchanged.","nullable":true},"source":{"type":"string","description":"The integration that owns the list; read at creation only."},"exposedInBooking":{"type":"boolean","description":"Whether online booking may match customers against this list."},"protocol":{"type":"string","enum":["ftp","ftps","sftp","http","https"],"nullable":true},"url":{"type":"string","maxLength":1000,"nullable":true},"credentials":{"type":"object","properties":{"username":{"type":"string","maxLength":200},"password":{"type":"string","maxLength":400},"privateKey":{"type":"string","maxLength":8000},"port":{"type":"integer","minimum":1}},"additionalProperties":false},"columnMapping":{"type":"object","properties":{"name":{"type":"string","maxLength":200,"minLength":1},"role":{"type":"string","maxLength":200},"email":{"type":"string","maxLength":200},"phone":{"type":"string","maxLength":200},"commune":{"type":"string","maxLength":200},"ref":{"type":"string","maxLength":200},"lat":{"type":"string","maxLength":200},"lng":{"type":"string","maxLength":200}},"required":["name"],"additionalProperties":false},"refreshInterval":{"type":"string","enum":["manual","6h","12h","24h","weekly"]},"active":{"type":"boolean"}},"required":["name","kind"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/companies/lists/{id}":{"delete":{"operationId":"deleteCompaniesListsId","tags":["Contacts"],"summary":"Delete a list (its records stay)","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","deleted"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/companies/lists/{id}/exposed":{"patch":{"operationId":"patchCompaniesListsIdExposed","tags":["Contacts"],"summary":"Show or hide a list in online booking","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"exposedInBooking":{"type":"boolean"}},"required":["id","exposedInBooking"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/companies/lists/{id}/run":{"post":{"operationId":"postCompaniesListsIdRun","tags":["Contacts"],"summary":"Refresh a hosted list now","description":"`400 list_not_hosted` for a list without a URL.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"queued":{"type":"boolean"}},"required":["id","queued"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/companies/lists/preview":{"post":{"operationId":"postCompaniesListsPreview","tags":["Contacts"],"summary":"Fetch a remote file and return its headers and first rows","description":"Saves nothing, so it answers `200`.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"protocol":{"type":"string","enum":["ftp","ftps","sftp","http","https"]},"url":{"type":"string","maxLength":1000,"minLength":3},"credentials":{"type":"object","properties":{"username":{"type":"string","maxLength":200},"password":{"type":"string","maxLength":400},"privateKey":{"type":"string","maxLength":8000},"port":{"type":"integer","minimum":1}},"additionalProperties":false},"listId":{"type":"string","description":"A saved list whose stored credentials are used when the body sends none."}},"required":["protocol","url"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"headers":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["headers","rows"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/contacts":{"get":{"operationId":"getContacts","tags":["Contacts"],"summary":"List the people attached to accounts","security":[{"apiKey":[]}],"parameters":[{"name":"clientId","in":"query","required":false,"schema":{"type":"string","maxLength":64},"description":"The people of one account."},{"name":"search","in":"query","required":false,"schema":{"type":"string","maxLength":200},"description":"Name, email or phone."},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["INDIVIDUAL","COMPANY","ALL"]},"description":"`COMPANY`: people of companies; `INDIVIDUAL`: people of households."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Default 50; a larger value is lowered to 100."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"Page size 50 by default, 100 at most; `limit` and `offset` are echoed back.","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"total":{"type":"integer","description":"Rows matching the filter, ignoring paging."},"limit":{"type":"integer"},"offset":{"type":"integer"}},"required":["items","total","limit","offset"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postContacts","tags":["Contacts"],"summary":"Create or update a person attached to an account","description":"Upsert by `id` only. A create needs `clientId` (the account) and `firstName` or `lastName`. Moving a contact to another account is `POST /contacts/{id}/move` (`400 use_move` here). The first contact of an account becomes its primary.\n\nSend `Idempotency-Key` to make a retry safe: the same key within 48 h replays the first response.","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"clientId":{"type":"string","maxLength":64,"description":"The account (a person or a company); required at creation."},"civility":{"type":"string","maxLength":20,"nullable":true},"firstName":{"type":"string","maxLength":120,"nullable":true},"lastName":{"type":"string","maxLength":120,"nullable":true},"role":{"type":"string","maxLength":120,"description":"Free text, e.g. \"Caretaker\", \"Accounting\".","nullable":true},"jobTitle":{"type":"string","maxLength":120,"nullable":true},"email":{"type":"string","maxLength":254,"nullable":true},"phone":{"type":"string","maxLength":40,"nullable":true},"mobile":{"type":"string","maxLength":40,"nullable":true},"isPrimary":{"type":"boolean","description":"Makes this person the account's primary contact — one at a time, the previous one loses it."},"notes":{"type":"string","maxLength":5000,"nullable":true},"position":{"type":"integer","minimum":0}},"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/contacts/{id}":{"delete":{"operationId":"deleteContactsId","tags":["Contacts"],"summary":"Delete an attached person","description":"Soft delete.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"get":{"operationId":"getContactsId","tags":["Contacts"],"summary":"Get one attached person","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/contacts/{id}/move":{"post":{"operationId":"postContactsIdMove","tags":["Contacts"],"summary":"Move an attached person to another account","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","maxLength":64}},"required":["clientId"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/contracts":{"get":{"operationId":"getContracts","tags":["Contrats"],"summary":"List maintenance contracts","description":"Needs the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":300},"description":"Default 300, at most 500 (a larger value is a 400)."},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"companyId","in":"query","required":false,"schema":{"type":"string"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"search","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"Page size 300 by default, 500 at most.","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Contract"}},"total":{"type":"integer","description":"Rows matching the filter, ignoring paging."}},"required":["items","total"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postContracts","tags":["Contrats"],"summary":"Create a contract","description":"Create only; `clientId` and `startsOn` are required. Defaults: reference `CTR-<year>-NNNN`, status `DRAFT`, 12-month cadence, auto-renewal, 60 days notice.\n\nSend `Idempotency-Key` to make a retry safe: the same key within 48 h replays the first response.\n\nNeeds the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string"},"contactId":{"type":"string","nullable":true},"siteId":{"type":"string","nullable":true},"startsOn":{"type":"string","format":"date-time"},"reference":{"type":"string","nullable":true},"planId":{"type":"string","description":"The workspace's ContractTemplate this contract is sold as.","nullable":true},"totalAnnualCents":{"type":"number","minimum":0},"currency":{"type":"string"},"vatRate":{"type":"number","nullable":true},"endsOn":{"type":"string","format":"date-time","nullable":true},"cadenceMonths":{"type":"number","minimum":1},"autoRenew":{"type":"boolean"},"noticeDays":{"type":"number","minimum":0},"billingDay":{"type":"number","minimum":1,"maximum":31,"nullable":true},"status":{"type":"string","enum":["DRAFT","PENDING_SIGNATURE","ACTIVE","SUSPENDED","EXPIRED","CANCELLED"]},"notes":{"type":"string","nullable":true}},"required":["clientId","startsOn"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/contracts/{id}":{"delete":{"operationId":"deleteContractsId","tags":["Contrats"],"summary":"Delete a draft contract","description":"Hard delete, `DRAFT` only (`400 delete_requires_draft`).\n\nNeeds the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"get":{"operationId":"getContractsId","tags":["Contrats"],"summary":"Get one contract with its client, lines and covered equipment","description":"Needs the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"contract":{"$ref":"#/components/schemas/Contract"},"client":{"type":"object","additionalProperties":true,"nullable":true},"lines":{"type":"array","items":{"type":"object","additionalProperties":true}},"coverage":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["contract","client","lines","coverage"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"patchContractsId","tags":["Contrats"],"summary":"Update one field of a contract","description":"One field per call: `{ \"field\": \"<name>\", \"value\": <new value> }`.\n\nNeeds the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"field":{"type":"string","enum":["status","autoRenew","notes","totalAnnualCents","billingDay","noticeDays","endsOn","cadenceMonths","clientId","contactId","siteId","currency","vatRate","startsOn","reference"]},"value":{}},"required":["field","value"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/contracts/{id}/cancel":{"patch":{"operationId":"patchContractsIdCancel","tags":["Contrats"],"summary":"Cancel a contract","description":"Needs the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/contracts/{id}/equipment":{"post":{"operationId":"postContractsIdEquipment","tags":["Contrats"],"summary":"Cover one more equipment item","description":"It must belong to the contract's client.\n\nNeeds the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"equipmentId":{"type":"string"}},"required":["equipmentId"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/contracts/{id}/equipment/{equipmentId}":{"delete":{"operationId":"deleteContractsIdEquipmentEquipmentId","tags":["Contrats"],"summary":"Stop covering an equipment item","description":"Needs the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"equipmentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"patchContractsIdEquipmentEquipmentId","tags":["Contrats"],"summary":"Change a covered item's cadence or intervention template","description":"Needs the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"equipmentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"cadenceMonths":{"type":"integer","minimum":1,"nullable":true},"templateId":{"type":"string","nullable":true}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/contracts/{id}/equipment/sync":{"post":{"operationId":"postContractsIdEquipmentSync","tags":["Contrats"],"summary":"Replace the whole set of covered equipment","description":"Needs the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"equipmentId":{"type":"string"},"cadenceMonths":{"type":"integer","minimum":1,"nullable":true},"templateId":{"type":"string","nullable":true}},"required":["equipmentId"],"additionalProperties":false}}},"required":["rows"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/contracts/{id}/lines":{"post":{"operationId":"postContractsIdLines","tags":["Contrats"],"summary":"Add or update (by id) a contract line","description":"Needs the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"serviceId":{"type":"string","nullable":true},"description":{"type":"string"},"quantity":{"type":"number","minimum":1},"unitPriceCents":{"type":"number"},"vatRate":{"type":"number","nullable":true}},"required":["description","quantity","unitPriceCents"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/contracts/{id}/lines/{lineId}":{"delete":{"operationId":"deleteContractsIdLinesLineId","tags":["Contrats"],"summary":"Delete a contract line","description":"Needs the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"lineId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/crm/specialties":{"get":{"operationId":"getCrmSpecialties","tags":["Contacts"],"summary":"The specialty codes a company can carry","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"color":{"type":"string","nullable":true},"icon":{"type":"string","nullable":true},"audience":{"type":"string"}},"required":["code","label","color","icon","audience"]}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/dashboard/campaigns":{"get":{"operationId":"getDashboardCampaigns","tags":["Statistiques"],"summary":"Campaign sends for a period","description":"Days `from`–`to` included, in the workspace time zone; impossible or reversed dates, or more than 366 days, are a `400 invalid_range`.","security":[{"apiKey":[]}],"parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"`YYYY-MM-DD`."},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"`YYYY-MM-DD`, not before `from`."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardCampaigns"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/dashboard/clients":{"get":{"operationId":"getDashboardClients","tags":["Statistiques"],"summary":"The client file: new clients, origins, contact quality, activity, loyalty and geography","description":"Days `from`–`to` included, in the workspace time zone; impossible or reversed dates, or more than 366 days, are a `400 invalid_range`.","security":[{"apiKey":[]}],"parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"`YYYY-MM-DD`."},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"`YYYY-MM-DD`, not before `from`."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardClients"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/dashboard/home":{"get":{"operationId":"getDashboardHome","tags":["Statistiques"],"summary":"Home tiles: quotes and invoices outstanding, revenue this month","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"tiles":{"type":"object","additionalProperties":true},"recentQuotes":{"type":"array","items":{"type":"object","additionalProperties":true}},"recentInvoices":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["tiles","recentQuotes","recentInvoices"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/dashboard/satisfaction":{"get":{"operationId":"getDashboardSatisfaction","tags":["Statistiques"],"summary":"Reviews, average rating and response rate for a period","description":"Days `from`–`to` included, in the workspace time zone; impossible or reversed dates, or more than 366 days, are a `400 invalid_range`.","security":[{"apiKey":[]}],"parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"`YYYY-MM-DD`."},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"`YYYY-MM-DD`, not before `from`."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardSatisfaction"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/dashboard/stats":{"get":{"operationId":"getDashboardStats","tags":["Statistiques"],"summary":"KPIs, time series and breakdowns for a period","description":"`range`: `7d`, `30d` (default), `90d`, `ytd`, `mtd`, or `custom` with `from`/`to`; any other value is a `400 validation_failed`.","security":[{"apiKey":[]}],"parameters":[{"name":"range","in":"query","required":false,"schema":{"type":"string","enum":["7d","30d","90d","ytd","mtd","custom"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardStats"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/dashboard/voice":{"get":{"operationId":"getDashboardVoice","tags":["Statistiques"],"summary":"Calls taken by the voice assistant for a period","description":"Days `from`–`to` included, in the workspace time zone; impossible or reversed dates, or more than 366 days, are a `400 invalid_range`.","security":[{"apiKey":[]}],"parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"`YYYY-MM-DD`."},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"`YYYY-MM-DD`, not before `from`."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardVoice"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/equipments":{"get":{"operationId":"getEquipments","tags":["Équipements"],"summary":"List equipment","description":"Needs the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":200},"description":"Default 200, at most 500 (a larger value is a 400)."},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"companyId","in":"query","required":false,"schema":{"type":"string"}},{"name":"siteId","in":"query","required":false,"schema":{"type":"string"},"description":"Everything installed at one address."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"Page size 200 by default, 500 at most.","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Equipment"}},"total":{"type":"integer","description":"Rows matching the filter, ignoring paging."}},"required":["items","total"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postEquipments","tags":["Équipements"],"summary":"Create an equipment item","description":"Create only. `label` and `clientId` are required; a `siteId` must belong to that client (`400 site_not_in_account`).\n\nSend `Idempotency-Key` to make a retry safe: the same key within 48 h replays the first response.\n\nNeeds the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"},"clientId":{"type":"string"},"siteId":{"type":"string"},"brand":{"type":"string","nullable":true},"model":{"type":"string","nullable":true},"serialNumber":{"type":"string","nullable":true}},"required":["label","clientId"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/equipments/{id}":{"delete":{"operationId":"deleteEquipmentsId","tags":["Équipements"],"summary":"Delete an equipment item","description":"Soft delete.\n\nNeeds the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"get":{"operationId":"getEquipmentsId","tags":["Équipements"],"summary":"Get one equipment item with its next planned appointment","description":"Needs the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"equipment":{"$ref":"#/components/schemas/Equipment"},"clientName":{"type":"string","nullable":true},"nextAppointment":{"type":"object","additionalProperties":true,"nullable":true}},"required":["equipment","clientName","nextAppointment"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"patchEquipmentsId","tags":["Équipements"],"summary":"Update one field of an equipment item","description":"One field per call: `{ \"field\": \"<name>\", \"value\": <new value> }`. A name that is not a built-in field is stored in `customFields` (`null` removes it).\n\nNeeds the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"field":{"type":"string"},"value":{}},"required":["field","value"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/equipments/{id}/documents":{"get":{"operationId":"getEquipmentsIdDocuments","tags":["Équipements"],"summary":"List an equipment item's documents","description":"Needs the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100},"description":"1–100; a larger value is lowered to 100. Without it (or with a value that is not a positive integer) the whole list comes back."},{"name":"before","in":"query","required":false,"schema":{"type":"string"},"description":"Cursor: the `nextBefore` of the previous page."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Document"}},"nextBefore":{"type":"string","description":"Pass as `before` for the next page; absent when `limit` was not sent.","nullable":true}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/equipments/{id}/photos":{"post":{"operationId":"postEquipmentsIdPhotos","tags":["Équipements"],"summary":"Add a photo (base64 data URL; jpeg, png, webp, heic; 12 MB, 30 photos at most)","description":"Needs the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string"},"mimeType":{"type":"string"},"dataUrl":{"type":"string","description":"`data:image/jpeg;base64,…` — the same envelope client documents use."}},"required":["filename","mimeType","dataUrl"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"photos":{"type":"array","items":{"type":"string","description":"Photo URL."}}},"required":["photos"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/equipments/{id}/photos/delete":{"post":{"operationId":"postEquipmentsIdPhotosDelete","tags":["Équipements"],"summary":"Remove a photo by URL","description":"Needs the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"photos":{"type":"array","items":{"type":"string","description":"Photo URL."}}},"required":["photos"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/equipments/bulk-delete":{"post":{"operationId":"postEquipmentsBulkDelete","tags":["Équipements"],"summary":"Delete several equipment items (500 at most)","description":"Needs the ERP modules on the workspace's plan — otherwise `402 erp_required`; `403 offer_disabled` when the ERP offer is switched off for the whole platform.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}}},"required":["ids"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"integer"}},"required":["deleted"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/external-refs":{"get":{"operationId":"getExternalRefs","tags":["IDs externes"],"summary":"Resolve your id to the IWANA id (or back)","description":"Send `provider`, `entityType` and either `externalId` (your id) or `localId` (the IWANA id). A miss is `200 { \"item\": null }`, never a 404 — the expected answer before a create.","security":[{"apiKey":[]}],"parameters":[{"name":"provider","in":"query","required":true,"schema":{"type":"string"},"description":"Your system, e.g. `hubspot`. Free text — be consistent."},{"name":"entityType","in":"query","required":true,"schema":{"type":"string"},"description":"Free text, e.g. `client`, `appointment`."},{"name":"externalId","in":"query","required":false,"schema":{"type":"string"},"description":"Your id. Takes precedence over `localId`."},{"name":"localId","in":"query","required":false,"schema":{"type":"string"},"description":"The IWANA id."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"item":{"oneOf":[{"$ref":"#/components/schemas/ExternalRef"},{"type":"null"}]}},"required":["item"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"put":{"operationId":"putExternalRefs","tags":["IDs externes"],"summary":"Record the mapping between your id and the IWANA id","description":"Upsert: matches on (provider, entityType, externalId), then on (provider, entityType, localId), otherwise creates. Each side is unique per provider and entity type.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string"},"entityType":{"type":"string"},"localId":{"type":"string"},"externalId":{"type":"string"},"shopId":{"type":"string","nullable":true},"payloadHash":{"type":"string","nullable":true}},"required":["provider","entityType","localId","externalId"],"additionalProperties":false},"example":{"provider":"mon-erp","entityType":"client","localId":"k7m2x9q4w1e8r5t3y6u0i2o4","externalId":"C-10482"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"item":{"$ref":"#/components/schemas/ExternalRef"}},"required":["item"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/fields":{"get":{"operationId":"getFields","tags":["Configuration"],"summary":"List the custom fields of one record type","description":"Values live in each record's `customFields`, keyed by the field `key`.","security":[{"apiKey":[]}],"parameters":[{"name":"scope","in":"query","required":true,"schema":{"type":"string"},"description":"Record type: `client`, `appointment`, `equipment`, `project`, `quote`, `invoice`, `contract`, `job_sheet`…"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postFields","tags":["Configuration"],"summary":"Create or update (by id) a custom field","description":"A `key` already used is `400 key_already_exists`.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"scope":{"type":"string"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]*$"},"label":{"type":"string","minLength":1},"type":{"type":"string","enum":["TEXT","LONGTEXT","EMAIL","PHONE","URL","NUMBER","DATE","CHECKBOX","SELECT","MULTI_SELECT","TAG","ADDRESS"]},"config":{"type":"object","additionalProperties":true},"group":{"type":"string","nullable":true},"position":{"type":"integer"},"required":{"type":"boolean"},"helpText":{"type":"string","nullable":true},"active":{"type":"boolean"}},"required":["scope","key","label","type"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/fields/{id}":{"delete":{"operationId":"deleteFieldsId","tags":["Configuration"],"summary":"Archive a custom field","description":"Built-in fields cannot be removed (403).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/fields/{id}/active":{"patch":{"operationId":"patchFieldsIdActive","tags":["Configuration"],"summary":"Show or hide a custom field","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"active":{"type":"boolean"}},"required":["active"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/fields/reorder":{"post":{"operationId":"postFieldsReorder","tags":["Configuration"],"summary":"Save the order of a record type's fields","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"type":"string"},"orderedIds":{"type":"array","items":{"type":"string"}}},"required":["scope","orderedIds"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/geo/regions":{"get":{"operationId":"getGeoRegions","tags":["Géo"],"summary":"French regions and their departments","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"insee":{"type":"string"},"label":{"type":"string"},"departments":{"type":"array","items":{"type":"string"}}},"required":["code","insee","label","departments"]}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/geo/resolve":{"get":{"operationId":"getGeoResolve","tags":["Géo"],"summary":"Geocode an address (placeId from suggest, or free text q)","description":"A miss is `{ \"result\": null }`.","security":[{"apiKey":[]}],"parameters":[{"name":"placeId","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"oneOf":[{"type":"object","properties":{"label":{"type":"string"},"line1":{"type":"string"},"postcode":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"countryCode":{"type":"string","nullable":true},"lat":{"type":"number"},"lng":{"type":"number"},"placeId":{"type":"string","nullable":true}},"required":["label","line1","postcode","city","countryCode","lat","lng","placeId"]},{"type":"null"}]}},"required":["result"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/geo/suggest":{"get":{"operationId":"getGeoSuggest","tags":["Géo"],"summary":"Address autocomplete (6 suggestions)","description":"`q` under 3 characters returns nothing.","security":[{"apiKey":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"sub":{"type":"string","nullable":true}},"required":["id","label","sub"]}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/integrations/me":{"get":{"operationId":"getIntegrationsMe","tags":["Intégration"],"summary":"Who am I: the workspace and permissions of this key","description":"A health check for an integration. `actor.kind` is `api_key` for a key, `oauth` for a token.","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"orgId":{"type":"string"},"actor":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"label":{"type":"string"},"mode":{"type":"string","enum":["live","test"]}}},"permissions":{"type":"array","items":{"type":"string"}},"locale":{"type":"string"},"timezone":{"type":"string"}},"required":["orgId","actor","permissions","locale","timezone"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/map/bootstrap":{"get":{"operationId":"getMapBootstrap","tags":["Rendez-vous"],"summary":"Map data: appointments in a window with their clients, services, locations and members","description":"`from`/`to` default to −30 / +60 days; a window over 100 days falls back to the default.","security":[{"apiKey":[]}],"parameters":[{"name":"clients","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"appointments","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"appointments":{"type":"array","items":{"type":"object","additionalProperties":true}},"services":{"type":"array","items":{"type":"object","additionalProperties":true}},"clients":{"type":"array","items":{"type":"object","additionalProperties":true}},"locations":{"type":"array","items":{"type":"object","additionalProperties":true}},"members":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/map/route":{"post":{"operationId":"postMapRoute","tags":["Rendez-vous"],"summary":"Driving route (polyline) through 2 to 27 ordered stops","description":"Computes and stores nothing, so it answers `200`. Billed to the workspace's metered credits. When routing is not available the answer is `{ \"status\": \"unavailable\" }`, not an error.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"stops":{"type":"array","items":{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180}},"required":["lat","lng"],"additionalProperties":false},"maxItems":27,"minItems":2}},"required":["stops"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","unavailable"]},"polyline":{"type":"string"}},"required":["status"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects":{"get":{"operationId":"getProjects","tags":["Chantiers"],"summary":"List chantiers, newest first","description":"Send `counts=1` to also get counts per status. Archived chantiers are left out; `inArchive=true` lists only them. Outside `collaborative=true` this needs the ERP modules (`402 erp_required`).\n\nA chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":200}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"collaborative","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"inArchive","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"companyId","in":"query","required":false,"schema":{"type":"string"}},{"name":"accountId","in":"query","required":false,"schema":{"type":"string"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"status","in":"query","required":false,"schema":{"type":"string","maxLength":32},"description":"One status (`IN_PROGRESS`…), compared upper-case — a chip of the list."},{"name":"archived","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"counts","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"Page size 200 by default, 500 at most.","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ProjectListItem"}},"total":{"type":"integer","description":"Rows matching the filter, ignoring paging."}},"required":["items","total"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postProjects","tags":["Chantiers"],"summary":"Create a chantier (draft, reference CH-…)","description":"Every field is optional.\n\nSend `Idempotency-Key` to make a retry safe: the same key within 48 h replays the first response.\n\nA chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"collaborative":{"type":"boolean"},"kind":{"type":"string","enum":["CHANTIER","INTERVENTION","AUTRE"]},"partyRoles":{"type":"array","items":{"type":"string"}},"clientId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true}},"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}":{"delete":{"operationId":"deleteProjectsId","tags":["Chantiers"],"summary":"Delete a chantier permanently","description":"Usually done from the archive; `POST …/archive` is the reversible delete. Emits `project.deleted`.\n\nA chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"get":{"operationId":"getProjectsId","tags":["Chantiers"],"summary":"Get one chantier","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"$ref":"#/components/schemas/Project"},"clientName":{"type":"string","nullable":true},"siteName":{"type":"string","nullable":true},"leadMemberName":{"type":"string","nullable":true},"memberNames":{"type":"array","items":{"type":"string"}}},"required":["project","clientName","siteName","leadMemberName","memberNames"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"patchProjectsId","tags":["Chantiers"],"summary":"Update one field of a chantier","description":"One field per call: `{ \"field\": \"<name>\", \"value\": <new value> }`. `customFields` is merged.\n\nA chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"field":{"type":"string"},"value":{}},"required":["field","value"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/archive":{"post":{"operationId":"postProjectsIdArchive","tags":["Chantiers"],"summary":"Archive a chantier","description":"The reversible delete: out of the list, read-only (writes answer `409 project_archived`), restorable. Emits `project.updated`.\n\nA chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"archived":{"type":"integer"}},"required":["archived"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/documents":{"post":{"operationId":"postProjectsIdDocuments","tags":["Chantiers"],"summary":"Upload a document to a chantier (base64 data URL, 14 MB)","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string"},"mimeType":{"type":"string"},"dataUrl":{"type":"string"},"visibility":{"type":"string","enum":["internal","shared"],"description":"'internal' (default) or 'shared' with the partner companies."},"audience":{"type":"array","items":{"type":"string","maxLength":80}},"approvers":{"type":"array","items":{"type":"string","maxLength":80}}},"required":["filename","mimeType","dataUrl"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"document":{"$ref":"#/components/schemas/Document"}},"required":["document"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/duplicate":{"post":{"operationId":"postProjectsIdDuplicate","tags":["Chantiers"],"summary":"Copy a chantier into a new draft (the chantier only, not its phases or tasks)","description":"Send `Idempotency-Key` to make a retry safe: the same key within 48 h replays the first response.\n\nA chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/measurements":{"post":{"operationId":"postProjectsIdMeasurements","tags":["Chantiers"],"summary":"Add or update (by id) a measurement","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string","maxLength":300},"roomId":{"type":"string","nullable":true},"valueMm":{"type":"integer","minimum":0,"nullable":true},"unit":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"sortOrder":{"type":"integer"}},"required":["label"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/measurements/{measurementId}":{"delete":{"operationId":"deleteProjectsIdMeasurementsMeasurementId","tags":["Chantiers"],"summary":"Delete a measurement","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"measurementId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/participants":{"get":{"operationId":"getProjectsIdParticipants","tags":["Chantiers"],"summary":"Everyone on the chantier, with invitation status","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postProjectsIdParticipants","tags":["Chantiers"],"summary":"Invite a company or a person onto the chantier","description":"Sends the invitation by email and SMS. A person needs an email and a phone, an outside company an email.\n\nA chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["company","person"]},"name":{"type":"string","maxLength":200},"email":{"type":"string","maxLength":200},"phone":{"type":"string","maxLength":40},"role":{"type":"string","maxLength":80},"orgId":{"type":"string","maxLength":64},"contactName":{"type":"string","maxLength":120},"clientId":{"type":"string","maxLength":64},"contactId":{"type":"string","maxLength":64}},"required":["kind"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"ok":{"type":"boolean"}},"required":["id","ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/parties":{"get":{"operationId":"getProjectsIdParties","tags":["Chantiers"],"summary":"The contacts and companies linked to a chantier, with their roles","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postProjectsIdParties","tags":["Chantiers"],"summary":"Link a contact or company to a chantier","description":"Exactly one of `clientId` / `companyId`. Linking sends nothing.\n\nA chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string"},"companyId":{"type":"string"},"contactId":{"type":"string","nullable":true},"role":{"type":"string","maxLength":80}},"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/parties/{partyId}":{"delete":{"operationId":"deleteProjectsIdPartiesPartyId","tags":["Chantiers"],"summary":"Unlink a party","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"partyId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/parties/{partyId}/resend":{"post":{"operationId":"postProjectsIdPartiesPartyIdResend","tags":["Chantiers"],"summary":"Resend the invitation of a pending party","description":"`partyId` is the `partyId` of the rows of `GET …/participants`. 400 `not_pending` once answered, 400 `party_no_email`, 403 `host_only`, 429 `resend_too_soon` within ten minutes.\n\nA chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"partyId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"invitedAt":{"type":"string"}},"required":["invitedAt"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/partners":{"post":{"operationId":"postProjectsIdPartners","tags":["Chantiers"],"summary":"Add or update (by id) a partner company on the chantier","description":"Sends nothing; invite with `…/partners/{partnerId}/invite`.\n\nA chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","maxLength":300},"trade":{"type":"string","nullable":true},"contactName":{"type":"string","nullable":true},"contactEmail":{"type":"string","nullable":true},"contactPhone":{"type":"string","nullable":true},"clientId":{"type":"string","nullable":true},"contactId":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"sortOrder":{"type":"integer"}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/partners/{partnerId}":{"delete":{"operationId":"deleteProjectsIdPartnersPartnerId","tags":["Chantiers"],"summary":"Remove a partner (and its access)","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"partnerId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/partners/{partnerId}/invite":{"delete":{"operationId":"deleteProjectsIdPartnersPartnerIdInvite","tags":["Chantiers"],"summary":"Withdraw a partner invitation","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"partnerId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postProjectsIdPartnersPartnerIdInvite","tags":["Chantiers"],"summary":"Email (and SMS) a partner its invitation link","description":"Needs the partner's `contactEmail`.\n\nA chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"partnerId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"invitedAt":{"type":"string","format":"date-time"}},"required":["ok","invitedAt"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/phases":{"post":{"operationId":"postProjectsIdPhases","tags":["Chantiers"],"summary":"Add or update (by id) a planning phase","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","maxLength":300},"color":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"startsOn":{"type":"string","nullable":true},"endsOn":{"type":"string","nullable":true},"assignee":{"type":"string","nullable":true},"sortOrder":{"type":"integer"}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/phases/{phaseId}":{"delete":{"operationId":"deleteProjectsIdPhasesPhaseId","tags":["Chantiers"],"summary":"Delete a phase","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"phaseId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/planning/share":{"post":{"operationId":"postProjectsIdPlanningShare","tags":["Chantiers"],"summary":"Email the planning to every participant with an email address","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"recipients":{"type":"array","items":{"type":"string","maxLength":80}},"message":{"type":"string","maxLength":2000}},"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"sent":{"type":"array","items":{"type":"string"}},"skipped":{"type":"array","items":{"type":"string"}}},"required":["sent","skipped"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/reserves":{"post":{"operationId":"postProjectsIdReserves","tags":["Chantiers"],"summary":"Add or update (by id) a reserve (snag item)","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string","maxLength":500},"status":{"type":"string","nullable":true},"resolvedAt":{"type":"string","nullable":true}},"required":["label"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/reserves/{reserveId}":{"delete":{"operationId":"deleteProjectsIdReservesReserveId","tags":["Chantiers"],"summary":"Delete a reserve","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"reserveId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/restore":{"post":{"operationId":"postProjectsIdRestore","tags":["Chantiers"],"summary":"Restore an archived chantier","description":"Emits `project.updated`.\n\nA chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"restored":{"type":"integer"}},"required":["restored"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/rooms":{"post":{"operationId":"postProjectsIdRooms","tags":["Chantiers"],"summary":"Add or update (by id) a room","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","maxLength":300},"areaSqm":{},"floor":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"sortOrder":{"type":"integer"}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/rooms/{roomId}":{"delete":{"operationId":"deleteProjectsIdRoomsRoomId","tags":["Chantiers"],"summary":"Delete a room","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"roomId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/site-meeting":{"post":{"operationId":"postProjectsIdSiteMeeting","tags":["Chantiers"],"summary":"The site-meeting service and the participants to pre-fill a chantier meeting with","description":"Creates the workspace's hidden « Réunion de chantier » service the first time it is asked for.\n\nA chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"serviceId":{"type":"string"},"participants":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["serviceId","participants"]}}}},"400":{"description":"`not_collaborative`: the project is not a collaborative one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_collaborative","message":"Not collaborative","requestId":"5f0c2a9e-3b7d-4e61-9a24-8c1f0e6d7b52"}}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/structure":{"get":{"operationId":"getProjectsIdStructure","tags":["Chantiers"],"summary":"Everything inside a chantier: phases, tasks, rooms, measurements, partners, reserves, money, linked records, documents","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"phases":{"type":"array","items":{"type":"object","additionalProperties":true}},"tasks":{"type":"array","items":{"type":"object","additionalProperties":true}},"rooms":{"type":"array","items":{"type":"object","additionalProperties":true}},"measurements":{"type":"array","items":{"type":"object","additionalProperties":true}},"partners":{"type":"array","items":{"type":"object","additionalProperties":true}},"reserves":{"type":"array","items":{"type":"object","additionalProperties":true}},"financials":{"type":"object","properties":{"quotedAcceptedCents":{"type":"integer"},"invoicedCents":{"type":"integer"},"paidCents":{"type":"integer"}},"required":["quotedAcceptedCents","invoicedCents","paidCents"]},"progressPct":{"type":"number"},"quotes":{"type":"array","items":{"type":"object","additionalProperties":true}},"invoices":{"type":"array","items":{"type":"object","additionalProperties":true}},"interventions":{"type":"array","items":{"type":"object","additionalProperties":true}},"appointments":{"type":"array","items":{"type":"object","additionalProperties":true}},"documents":{"type":"array","items":{"type":"object","additionalProperties":true}},"folders":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/tasks":{"post":{"operationId":"postProjectsIdTasks","tags":["Chantiers"],"summary":"Add or update (by id) a chantier work item","description":"Not the workspace to-dos of `/tasks`. On an update only the keys sent change.\n\nA chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","maxLength":500},"lot":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"dueDate":{"type":"string","nullable":true},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true},"assignee":{"type":"string","nullable":true},"durationMinutes":{"type":"integer","minimum":0,"description":"Estimated effort in minutes; null clears the estimate.","nullable":true},"sortOrder":{"type":"integer"}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/{id}/tasks/{taskId}":{"delete":{"operationId":"deleteProjectsIdTasksTaskId","tags":["Chantiers"],"summary":"Delete a chantier work item","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"taskId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/bulk-archive":{"post":{"operationId":"postProjectsBulkArchive","tags":["Chantiers"],"summary":"Archive several chantiers (500 at most)","description":"Ids out of reach or already archived are skipped; `archived` counts the rest.\n\nA chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}}},"required":["ids"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"archived":{"type":"integer"}},"required":["archived"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/documents/{documentId}":{"delete":{"operationId":"deleteProjectsDocumentsDocumentId","tags":["Chantiers"],"summary":"Delete a chantier document and its file","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/documents/{documentId}/approve":{"post":{"operationId":"postProjectsDocumentsDocumentIdApprove","tags":["Chantiers"],"summary":"Approve a shared site report on behalf of the workspace","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"approval":{"type":"object","additionalProperties":true}},"required":["approval"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/documents/{documentId}/audience":{"post":{"operationId":"postProjectsDocumentsDocumentIdAudience","tags":["Chantiers"],"summary":"Set who on the chantier can open a document","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"audience":{"type":"array","items":{"type":"string","maxLength":80}}},"required":["audience"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"audience":{"type":"array","items":{"type":"string"}}},"required":["ok","audience"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/documents/{documentId}/content":{"get":{"operationId":"getProjectsDocumentsDocumentIdContent","tags":["Chantiers"],"summary":"Download a chantier document (thumb=1 for its thumbnail)","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"download","in":"query","required":false,"schema":{"type":"string"}},{"name":"thumb","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The file's bytes, with its own `Content-Type`.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/documents/{documentId}/pdf":{"get":{"operationId":"getProjectsDocumentsDocumentIdPdf","tags":["Chantiers"],"summary":"A site report rendered as PDF","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"download","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The file's bytes, with its own `Content-Type`.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"`report_draft`: the report is still a draft.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"report_draft","message":"Report draft","requestId":"5f0c2a9e-3b7d-4e61-9a24-8c1f0e6d7b52"}}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/documents/{documentId}/preview":{"get":{"operationId":"getProjectsDocumentsDocumentIdPreview","tags":["Chantiers"],"summary":"A .docx document as text blocks","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"blocks":{"type":"array","items":{"type":"object","additionalProperties":true}},"truncated":{"type":"boolean"}},"required":["blocks","truncated"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/documents/{documentId}/read":{"post":{"operationId":"postProjectsDocumentsDocumentIdRead","tags":["Chantiers"],"summary":"Mark a shared site report as read","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/documents/{documentId}/sharing":{"post":{"operationId":"postProjectsDocumentsDocumentIdSharing","tags":["Chantiers"],"summary":"Share a document with partner companies and the client (older model)","description":"A chantier that is not collaborative (no `collaborative` flag, no partner company, no invited private customer) belongs to the ERP modules: without them on the workspace's plan the answer is `402 erp_required`, and `403 offer_disabled` when the ERP offer is switched off for the whole platform. A collaborative project stays open on every plan — unless the collaborative-projects offer is switched off platform-wide and the workspace has no ERP (`403 offer_disabled`).","security":[{"apiKey":[]}],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"partnerIds":{"type":"array","items":{"type":"string"}},"client":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"$ref":"#/components/responses/ErpRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/invitations":{"get":{"operationId":"getProjectsInvitations","tags":["Chantiers"],"summary":"Pending invitations other workspaces sent to this one (50 at most)","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/partners/directory":{"get":{"operationId":"getProjectsPartnersDirectory","tags":["Chantiers"],"summary":"Companies this workspace has already worked with","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/partners/iwana":{"get":{"operationId":"getProjectsPartnersIwana","tags":["Chantiers"],"summary":"Search IWANA companies with a public profile (8 results)","security":[{"apiKey":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"orgId":{"type":"string"},"name":{"type":"string"},"logoUrl":{"type":"string","nullable":true},"city":{"type":"string","nullable":true}},"required":["orgId","name","logoUrl","city"]}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/projects/partners/trades":{"get":{"operationId":"getProjectsPartnersTrades","tags":["Chantiers"],"summary":"The trades a partner can be tagged with","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"color":{"type":"string","nullable":true},"icon":{"type":"string","nullable":true}},"required":["code","label","color","icon"]}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/sandbox/reset":{"post":{"operationId":"postSandboxReset","tags":["Bac à sable"],"summary":"Reset the sandbox to its demo data","description":"Erases everything the workspace holds in the sandbox — records, captured messages, files — and writes the demo data again, with the same ids and dates following today. `seed: false` leaves the workspace empty instead. Any test key of the workspace may call it, whatever its scopes; the real workspace is never touched.","security":[{"apiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"seed":{"type":"boolean","description":"`false` leaves the workspace empty instead of putting the demo data back."}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"seeded":{"type":"boolean","description":"`true` when the demo data was written again."}},"required":["ok","seeded"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"description":"`sandbox_requires_test_key`: only a test key can reset a sandbox.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"sandbox_requires_test_key","message":"Sandbox requires test key","requestId":"5f0c2a9e-3b7d-4e61-9a24-8c1f0e6d7b52"}}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"`rate_limited`: one reset a minute per workspace; `Retry-After` says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Rate limited","requestId":"5f0c2a9e-3b7d-4e61-9a24-8c1f0e6d7b52"}}}}}}}},"/pro/sandbox/webhooks":{"get":{"operationId":"getSandboxWebhooks","tags":["Bac à sable"],"summary":"List the test webhook endpoints","description":"The endpoints that receive the events of this sandbox, oldest first. They are separate from the endpoints of the real workspace (Réglages → Développeurs), which never receive a sandbox event. A reset keeps them.","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"successCount":{"type":"integer"},"failureCount":{"type":"integer"},"lastDeliveryAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","url","events","active","successCount","failureCount","lastDeliveryAt","createdAt"]}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"description":"`sandbox_requires_test_key`: test endpoints are managed with a test key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"sandbox_requires_test_key","message":"Sandbox requires test key","requestId":"5f0c2a9e-3b7d-4e61-9a24-8c1f0e6d7b52"}}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postSandboxWebhooks","tags":["Bac à sable"],"summary":"Add a test webhook endpoint","description":"Every event of the sandbox listed in `events` is posted to `url`, signed with the `secret` of the endpoint and carrying `livemode: false` — otherwise exactly as a live event (see `webhooks.event`). The `secret` is in this answer only. Up to 10 endpoints per workspace.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"A public `https` or `http` address — `http` so that a tunnel to your machine works. An address of a private network, or a name that resolves to one, is refused."},"events":{"type":"array","items":{"type":"string","enum":["appointment.created","appointment.updated","appointment.cancelled","client.created","client.updated","client.deleted","quote.created","quote.updated","quote.deleted","invoice.created","invoice.updated","invoice.deleted","payment.created","intervention.created","intervention.updated","intervention.deleted","project.created","project.updated","project.deleted"]},"minItems":1,"description":"The event types to receive; `x-iwana-webhook-events` lists them."}},"required":["url","events"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"successCount":{"type":"integer"},"failureCount":{"type":"integer"},"lastDeliveryAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"secret":{"type":"string","description":"The signing secret (`whsec_…`). Shown once."}},"required":["id","url","events","active","successCount","failureCount","lastDeliveryAt","createdAt","secret"]}}}},"400":{"description":"`webhook_url_invalid`, `webhook_url_unresolved` or `webhook_url_not_public`: the address is not a public `http(s)` one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"webhook_url_invalid","message":"Webhook url invalid","requestId":"5f0c2a9e-3b7d-4e61-9a24-8c1f0e6d7b52"}}}}},"401":{"description":"`sandbox_requires_test_key`: test endpoints are managed with a test key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"sandbox_requires_test_key","message":"Sandbox requires test key","requestId":"5f0c2a9e-3b7d-4e61-9a24-8c1f0e6d7b52"}}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"`webhook_limit_reached`: the workspace already has 10 test endpoints.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"webhook_limit_reached","message":"Webhook limit reached","requestId":"5f0c2a9e-3b7d-4e61-9a24-8c1f0e6d7b52"}}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/sandbox/webhooks/{id}":{"delete":{"operationId":"deleteSandboxWebhooksId","tags":["Bac à sable"],"summary":"Remove a test webhook endpoint","description":"The endpoint stops receiving events at once; its deliveries go with it.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"description":"`sandbox_requires_test_key`: test endpoints are managed with a test key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"sandbox_requires_test_key","message":"Sandbox requires test key","requestId":"5f0c2a9e-3b7d-4e61-9a24-8c1f0e6d7b52"}}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/sandbox/webhooks/{id}/deliveries":{"get":{"operationId":"getSandboxWebhooksIdDeliveries","tags":["Bac à sable"],"summary":"List the latest deliveries to a test endpoint","description":"The 50 latest deliveries, newest first: the body that was sent, the status your endpoint answered, or why nothing was sent. The answer of your endpoint itself is not kept here.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string"},"attempt":{"type":"integer"},"delivered":{"type":"boolean","description":"`true` when the endpoint answered `2xx`."},"responseStatus":{"type":"integer","description":"The HTTP status the endpoint answered; `null` when nothing answered.","nullable":true},"error":{"type":"string","description":"Why nothing answered — a refused address (`webhook_url_not_public`), a timeout, a failed connection; `null` when there is a status.","nullable":true},"payload":{"type":"object","additionalProperties":true,"description":"The body that was posted."},"createdAt":{"type":"string","format":"date-time"}},"required":["id","event","attempt","delivered","responseStatus","error","payload","createdAt"]}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"description":"`sandbox_requires_test_key`: test endpoints are managed with a test key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"sandbox_requires_test_key","message":"Sandbox requires test key","requestId":"5f0c2a9e-3b7d-4e61-9a24-8c1f0e6d7b52"}}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/sandbox/webhooks/trigger":{"post":{"operationId":"postSandboxWebhooksTrigger","tags":["Bac à sable"],"summary":"Trigger a test event","description":"Sends `event` now to the test endpoints that listen to it, as if it had just happened: same body, same signature. `data` is an example built on the demo data — an appointment, a client, a quote or an invoice of it, which `GET` returns while the demo data is there; payments, interventions and projects are examples whose ids lead nowhere. Nothing is created or changed in the workspace. The delivery is asynchronous: read its outcome with `GET /sandbox/webhooks/{id}/deliveries`.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"string","enum":["appointment.created","appointment.updated","appointment.cancelled","client.created","client.updated","client.deleted","quote.created","quote.updated","quote.deleted","invoice.created","invoice.updated","invoice.deleted","payment.created","intervention.created","intervention.updated","intervention.deleted","project.created","project.updated","project.deleted"]}},"required":["event"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"event":{"type":"string"},"endpoints":{"type":"integer","description":"How many endpoints the event is being sent to."},"data":{"type":"object","additionalProperties":true,"description":"The `data` of the event that was sent."}},"required":["ok","event","endpoints","data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"description":"`sandbox_requires_test_key`: test endpoints are managed with a test key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"sandbox_requires_test_key","message":"Sandbox requires test key","requestId":"5f0c2a9e-3b7d-4e61-9a24-8c1f0e6d7b52"}}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/sites":{"get":{"operationId":"getSites","tags":["Sites"],"summary":"List sites, with their on-site people","security":[{"apiKey":[]}],"parameters":[{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"},"description":"The sites of one contact."},{"name":"clientIds","in":"query","required":false,"schema":{"type":"string","maxLength":2000},"description":"The sites of several accounts: comma-separated ids, 50 at most."},{"name":"companyId","in":"query","required":false,"schema":{"type":"string"},"description":"A company's sites: its own and those of its people."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":200},"description":"Default 200; a larger value is lowered to 500."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"Page size 200 by default, 500 at most; `limit` and `offset` are echoed back.","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Site"}},"total":{"type":"integer","description":"Rows matching the filter, ignoring paging."},"limit":{"type":"integer"},"offset":{"type":"integer"}},"required":["items","total","limit","offset"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postSites","tags":["Sites"],"summary":"Create a site","description":"Create only (update with `PATCH /sites/{id}`). The owner is required: `clientId` or `companyId` (when both are sent, `companyId` wins) — without one the answer is `400 owner_required`; an owner id that is not in the workspace is a `404`. `line1` is optional. Send `lat`/`lng` if you already have them.\n\nSend `Idempotency-Key` to make a retry safe: the same key within 48 h replays the first response.","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string"},"companyId":{"type":"string","description":"The owning company, when the site belongs to no person in particular."},"label":{"type":"string","maxLength":200,"nullable":true},"line1":{"type":"string","maxLength":300},"line2":{"type":"string","maxLength":300,"nullable":true},"postcode":{"type":"string","maxLength":20,"nullable":true},"city":{"type":"string","maxLength":160,"nullable":true},"country":{"type":"string","maxLength":80,"nullable":true},"lat":{"type":"number","nullable":true},"lng":{"type":"number","nullable":true},"accessNotes":{"type":"string","maxLength":2000,"nullable":true},"contactName":{"type":"string","maxLength":160,"nullable":true},"contactPhone":{"type":"string","maxLength":40,"nullable":true},"active":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/sites/{id}":{"delete":{"operationId":"deleteSitesId","tags":["Sites"],"summary":"Delete a site","description":"Soft delete.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"get":{"operationId":"getSitesId","tags":["Sites"],"summary":"Get one site, with its people and owner","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Site"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"patchSitesId","tags":["Sites"],"summary":"Update a site","description":"Omitted fields are kept, `null` clears. `companyId` is ignored here.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string"},"companyId":{"type":"string","description":"Ignored on an update: the owner is set at creation."},"label":{"type":"string","maxLength":200,"nullable":true},"line1":{"type":"string","maxLength":300},"line2":{"type":"string","maxLength":300,"nullable":true},"postcode":{"type":"string","maxLength":20,"nullable":true},"city":{"type":"string","maxLength":160,"nullable":true},"country":{"type":"string","maxLength":80,"nullable":true},"lat":{"type":"number","nullable":true},"lng":{"type":"number","nullable":true},"accessNotes":{"type":"string","maxLength":2000,"nullable":true},"contactName":{"type":"string","maxLength":160,"nullable":true},"contactPhone":{"type":"string","maxLength":40,"nullable":true},"active":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/sites/{id}/contacts":{"post":{"operationId":"postSitesIdContacts","tags":["Sites"],"summary":"Replace the people of a site (owner, agency, tenant…)","description":"The list sent is the whole list.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string","description":"A real contact record, when the person is one of the workspace's.","nullable":true},"contactId":{"type":"string","nullable":true},"role":{"type":"string","maxLength":40},"name":{"type":"string","maxLength":160,"nullable":true},"email":{"type":"string","maxLength":200,"nullable":true},"phone":{"type":"string","maxLength":40,"nullable":true},"isPrimary":{"type":"boolean"}},"additionalProperties":false},"description":"The WHOLE list — anything absent is removed."}},"required":["contacts"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/sites/{id}/documents":{"get":{"operationId":"getSitesIdDocuments","tags":["Sites"],"summary":"Documents of a site, its appointments and its equipment","description":"200 at most.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Document"}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/sites/bulk-delete":{"post":{"operationId":"postSitesBulkDelete","tags":["Sites"],"summary":"Delete several sites","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}}},"required":["ids"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"deleted":{"type":"integer"}},"required":["ok","deleted"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/tasks":{"get":{"operationId":"getTasks","tags":["Tâches"],"summary":"List to-dos by due date","description":"Not paginated: at most 500 (`cap`).","security":[{"apiKey":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["TODO","IN_PROGRESS","DONE","CANCELLED"]}},{"name":"assignee","in":"query","required":false,"schema":{"type":"string"}},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["voice_call"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"total":{"type":"integer"},"cap":{"type":"integer"}},"required":["items","total","cap"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postTasks","tags":["Tâches"],"summary":"Create or update a to-do","description":"Upsert by `id` (unknown: 404); `title` is required. On an update send the whole task: omitted `status`, `dueAt`, `assigneeId`, `tags` are reset.\n\nSend `Idempotency-Key` to make a retry safe: the same key within 48 h replays the first response.","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string","maxLength":500,"minLength":1},"description":{"type":"string","maxLength":20000,"nullable":true},"status":{"type":"string","enum":["TODO","IN_PROGRESS","DONE","CANCELLED"]},"priority":{"type":"string","enum":["LOW","NORMAL","HIGH","URGENT"]},"dueAt":{"type":"string","nullable":true},"assigneeId":{"type":"string","nullable":true},"targetKind":{"type":"string","nullable":true},"targetId":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"references":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["client","contact","site","appointment","project","quote","invoice","intervention","contract","equipment","service","call"]},"id":{"type":"string","maxLength":100,"minLength":1},"label":{"type":"string","maxLength":200,"nullable":true}},"required":["type","id"],"additionalProperties":false},"maxItems":30,"description":"Absent = keep the task's mentions; an array replaces them."}},"required":["title"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/tasks/{id}":{"delete":{"operationId":"deleteTasksId","tags":["Tâches"],"summary":"Delete a to-do","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/tasks/{id}/status":{"patch":{"operationId":"patchTasksIdStatus","tags":["Tâches"],"summary":"Set a to-do's status","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["TODO","IN_PROGRESS","DONE","CANCELLED"]}},"required":["status"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/team":{"get":{"operationId":"getTeam","tags":["Équipe"],"summary":"List members, teams and who is in which team","description":"Removed members and archived teams are included, with `deletedAt` set.","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"members":{"type":"array","items":{"$ref":"#/components/schemas/Member"}},"teams":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"icon":{"type":"string","nullable":true},"color":{"type":"string","nullable":true},"active":{"type":"boolean"},"deletedAt":{"type":"string","format":"date-time","nullable":true}},"required":["id","name","description","icon","color","active","deletedAt"]}},"teamMembers":{"type":"array","items":{"type":"object","properties":{"teamId":{"type":"string"},"membershipId":{"type":"string"}},"required":["teamId","membershipId"]}}},"required":["members","teams","teamMembers"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/team/members/{id}":{"delete":{"operationId":"deleteTeamMembersId","tags":["Équipe"],"summary":"Remove a member","description":"Suspends the membership; an owner cannot be removed.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/team/members/{id}/base-address":{"patch":{"operationId":"patchTeamMembersIdBaseAddress","tags":["Équipe"],"summary":"Set or clear a member's starting address for routes","description":"Must carry `lat`/`lng` (`400 address_not_geocoded`); geocode with `GET /geo/resolve`.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"baseAddress":{"type":"object","properties":{"label":{"type":"string","maxLength":300,"nullable":true},"line1":{"type":"string","maxLength":200,"nullable":true},"postcode":{"type":"string","maxLength":20,"nullable":true},"city":{"type":"string","maxLength":120,"nullable":true},"countryCode":{"type":"string","maxLength":4,"nullable":true},"departmentCode":{"type":"string","maxLength":10,"nullable":true},"regionCode":{"type":"string","maxLength":10,"nullable":true},"regionLabel":{"type":"string","maxLength":120,"nullable":true},"placeId":{"type":"string","maxLength":200,"nullable":true},"lat":{"type":"number","minimum":-90,"maximum":90,"nullable":true},"lng":{"type":"number","minimum":-180,"maximum":180,"nullable":true}},"additionalProperties":false,"nullable":true}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/team/members/{id}/color":{"patch":{"operationId":"patchTeamMembersIdColor","tags":["Équipe"],"summary":"Set or clear a member's calendar colour (#RRGGBB)","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"color":{"type":"string","nullable":true}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/team/members/{id}/invite-link":{"get":{"operationId":"getTeamMembersIdInviteLink","tags":["Équipe"],"summary":"The acceptance link of a pending invitation","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"link":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}},"required":["link","expiresAt"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/team/members/{id}/invite/resend":{"post":{"operationId":"postTeamMembersIdInviteResend","tags":["Équipe"],"summary":"Send a pending invitation again (new link, 14 days)","description":"Within 60 s of the last one: `429 resend_too_soon`.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"expiresAt":{"type":"string","format":"date-time"}},"required":["ok","expiresAt"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/team/members/{id}/permissions":{"patch":{"operationId":"patchTeamMembersIdPermissions","tags":["Équipe"],"summary":"Override a member's permission level per category","description":"`null` returns a category to the role default. Owners cannot be changed.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"overrides":{"type":"object","additionalProperties":true}},"required":["overrides"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"overrides":{"type":"object","additionalProperties":true},"levels":{"type":"object","additionalProperties":true}},"required":["ok","overrides","levels"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/team/members/{id}/restore":{"post":{"operationId":"postTeamMembersIdRestore","tags":["Équipe"],"summary":"Restore a removed member","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/team/members/{id}/role":{"patch":{"operationId":"patchTeamMembersIdRole","tags":["Équipe"],"summary":"Change a member's role","description":"Only an owner can grant or remove `OWNER`, and only an owner or admin can touch `ADMIN` — a key is neither, so those changes are refused (`403 forbidden_admin`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["OWNER","ADMIN","MANAGER","COLLABORATOR","VIEWER","ARTISAN"]}},"required":["role"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/team/members/invite":{"post":{"operationId":"postTeamMembersInvite","tags":["Équipe"],"summary":"Invite a team member (a colleague, NOT a contact)","description":"Adds somebody to the WORKSPACE — a technician, an office manager — and emails them an invitation valid 14 days. This is the endpoint for \"ajouter un membre / un collaborateur / quelqu'un à l'équipe\"; for a customer or a prospect use `POST /clients`. `OWNER` cannot be invited (`400 invalid_role`); an active member is a `400 member_exists`.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"role":{"type":"string","enum":["OWNER","ADMIN","MANAGER","COLLABORATOR","VIEWER","ARTISAN"]},"displayName":{"type":"string","maxLength":120},"linkedWorkspaceId":{"type":"string","maxLength":60,"description":"ARTISAN invites: the invitee company's own PRO workspace id."}},"required":["email","role"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"membershipId":{"type":"string"},"pending":{"type":"boolean"}},"required":["ok","membershipId","pending"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/team/permissions":{"get":{"operationId":"getTeamPermissions","tags":["Équipe"],"summary":"The permission matrix: categories, role defaults and each member's levels","description":"Partner companies (`ARTISAN`) and removed members are not in the matrix.","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"offers":{"type":"array","items":{"type":"object","additionalProperties":true}},"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"offer":{"type":"string","nullable":true},"levels":{"type":"array","items":{"type":"string"}}},"required":["id","offer","levels"]}},"roleDefaults":{"type":"object","description":"Role → category id → level.","additionalProperties":{"type":"object","additionalProperties":{"type":"string"}}},"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Membership id."},"role":{"type":"string"},"locked":{"type":"boolean","description":"`true` for the owner, whose levels cannot change."},"overrides":{"type":"object","additionalProperties":{"type":"string"}},"levels":{"type":"object","additionalProperties":{"type":"string"}}},"required":["id","role","locked","overrides","levels"]}},"canEdit":{"type":"boolean","description":"Whether this caller may change levels (`PATCH /team/members/{id}/permissions`)."}},"required":["offers","categories","roleDefaults","members","canEdit"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/team/teams":{"post":{"operationId":"postTeamTeams","tags":["Équipe"],"summary":"Create or update a team (a crew of members)","description":"Upsert by `id`.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","maxLength":120,"minLength":1},"description":{"type":"string","maxLength":500,"nullable":true},"icon":{"type":"string","maxLength":60,"nullable":true},"color":{"type":"string","maxLength":30,"nullable":true}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"id":{"type":"string"}},"required":["ok","id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/team/teams/{id}":{"delete":{"operationId":"deleteTeamTeamsId","tags":["Équipe"],"summary":"Archive a team","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/team/teams/{id}/members":{"post":{"operationId":"postTeamTeamsIdMembers","tags":["Équipe"],"summary":"Add an existing member to a team","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"membershipId":{"type":"string"}},"required":["membershipId"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/team/teams/{id}/members/{membershipId}":{"delete":{"operationId":"deleteTeamTeamsIdMembersMembershipId","tags":["Équipe"],"summary":"Remove a member from a team","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"membershipId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/team/teams/{id}/restore":{"post":{"operationId":"postTeamTeamsIdRestore","tags":["Équipe"],"summary":"Restore an archived team","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/workflows":{"post":{"operationId":"postWorkflows","tags":["Workflows"],"summary":"Create an automation (draft)","description":"`name`, plus a `templateId`, a `spec` or an `object`. Never activates it. A key or a token cannot save a Léo (`ask_leo`) step, a template's included: `403 scope_required` with `details.reason: ai_step_session_only`.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":120},"templateId":{"type":"string","description":"Start from a shipped template…"},"object":{"type":"string","description":"…or blank on a chosen object."},"spec":{"type":"object","additionalProperties":true},"description":{"type":"string","maxLength":500,"description":"Carried alongside a ready-made spec — the AI's one-line summary."}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/workflows/{id}":{"delete":{"operationId":"deleteWorkflowsId","tags":["Workflows"],"summary":"Archive an automation and cancel its pending runs","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"get":{"operationId":"getWorkflowsId","tags":["Workflows"],"summary":"Get one automation with its spec and run counters","description":"An older workflow that is not an automation is a `400 not_an_automation`.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["DRAFT","ACTIVE","PAUSED","ARCHIVED"]},"version":{"type":"integer"},"objectScope":{"type":"string","description":"The record type it runs on."},"spec":{"type":"object","additionalProperties":true,"description":"The automation itself: `{ format: \"automation/v1\", object, trigger, steps, … }`."},"canEdit":{"type":"boolean","description":"Whether this caller may change it."},"runCountTotal":{"type":"integer"},"runCountSucceeded":{"type":"integer"},"runCountFailed":{"type":"integer"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","description","status","version","objectScope","spec","canEdit","runCountTotal","runCountSucceeded","runCountFailed","updatedAt"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"patchWorkflowsId","tags":["Workflows"],"summary":"Change an automation's name, description or spec","description":"A key or a token may keep the Léo (`ask_leo`) steps a person wrote, not add or change one (`403 scope_required`, `details.reason: ai_step_session_only`).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":120},"description":{"type":"string","maxLength":500},"spec":{"type":"object","additionalProperties":true}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/workflows/{id}/duplicate":{"post":{"operationId":"postWorkflowsIdDuplicate","tags":["Workflows"],"summary":"Copy an automation as a draft","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":120}},"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/workflows/{id}/runs":{"get":{"operationId":"getWorkflowsIdRuns","tags":["Workflows"],"summary":"The latest runs of one automation (200)","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"includeSkipped","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/workflows/{id}/status":{"patch":{"operationId":"patchWorkflowsIdStatus","tags":["Workflows"],"summary":"Activate, pause or archive an automation","description":"Activating one with no steps is `400 empty_workflow`.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ACTIVE","PAUSED","ARCHIVED"]}},"required":["status"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/workflows/{id}/test":{"post":{"operationId":"postWorkflowsIdTest","tags":["Workflows"],"summary":"Dry-run an automation against a real record","description":"Shows what each step would do; nothing is sent or written, so it answers `200`.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"subjectId":{"type":"string","description":"The record to dry-run against. Absent for a `workspace` sequence, which has no record — it runs on the workspace and the period just ended."}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"outcome":{"type":"string"},"log":{"type":"array","items":{"type":"object","additionalProperties":true}},"actions":{"type":"array","items":{"type":"object","additionalProperties":true}},"reason":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/workflows/bootstrap":{"get":{"operationId":"getWorkflowsBootstrap","tags":["Workflows"],"summary":"List automations and the published templates","description":"The list route; archived automations are left out.","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"vertical":{"type":"string","nullable":true},"canEdit":{"type":"boolean"},"workflows":{"type":"array","items":{"type":"object","additionalProperties":true}},"automationTemplates":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["vertical","canEdit","workflows","automationTemplates"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/workflows/runs":{"get":{"operationId":"getWorkflowsRuns","tags":["Workflows"],"summary":"The latest runs across all automations (200)","security":[{"apiKey":[]}],"parameters":[{"name":"includeSkipped","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/workflows/runs/{runId}":{"get":{"operationId":"getWorkflowsRunsRunId","tags":["Workflows"],"summary":"One run with its step log","security":[{"apiKey":[]}],"parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"workflowName":{"type":"string"},"triggerEvent":{"type":"string"},"status":{"type":"string","enum":["QUEUED","RUNNING","WAITING","COMPLETED","SKIPPED","FAILED","CANCELLED","AWAITING_APPROVAL"]},"subjectKind":{"type":"string","nullable":true},"subjectId":{"type":"string","description":"The record the run is about.","nullable":true},"errorMessage":{"type":"string","nullable":true},"steps":{"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["ok","stopped","waiting","failed","info"]},"detail":{"type":"string"},"at":{"type":"string","format":"date-time"}}},"description":"The step log, in order."},"wakeAt":{"type":"string","format":"date-time","description":"When a waiting run resumes.","nullable":true},"startedAt":{"type":"string","format":"date-time","nullable":true},"finishedAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"durationMs":{"type":"integer","nullable":true}},"required":["id","workflowId","workflowName","triggerEvent","status","subjectKind","subjectId","errorMessage","steps","wakeAt","startedAt","finishedAt","createdAt","durationMs"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/workflows/runs/{runId}/approve":{"post":{"operationId":"postWorkflowsRunsRunIdApprove","tags":["Workflows"],"summary":"Approve a run waiting for approval","description":"The run resumes and its remaining actions — sends included — run.","security":[{"apiKey":[]}],"parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/workflows/runs/{runId}/reject":{"post":{"operationId":"postWorkflowsRunsRunIdReject","tags":["Workflows"],"summary":"Reject a run waiting for approval","security":[{"apiKey":[]}],"parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/workflows/schema":{"get":{"operationId":"getWorkflowsSchema","tags":["Workflows"],"summary":"Fields and relations available to automations on one record type","security":[{"apiKey":[]}],"parameters":[{"name":"scope","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"type":"string"},"fields":{"type":"array","items":{"type":"object","additionalProperties":true}},"relations":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["scope","fields","relations"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pro/workflows/templates/{templateId}":{"get":{"operationId":"getWorkflowsTemplatesTemplateId","tags":["Workflows"],"summary":"One published automation template with its spec","description":"Letters in the spec are named by preset slug, not resolved for the workspace.","security":[{"apiKey":[]}],"parameters":[{"name":"templateId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"category":{"type":"string","enum":["appointment","quote","invoice","equipment","contract","client","project","workspace"]},"group":{"type":"string","enum":["appointment","aftercare","collab","reporting","billing","assets"]},"channel":{"type":"string","enum":["email","sms","both","none"],"description":"What its steps send."},"spec":{"type":"object","additionalProperties":true,"description":"The automation itself: `{ format: \"automation/v1\", object, trigger, steps, … }`."}},"required":["id","name","description","category","group","channel","spec"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}},"x-iwana-webhook-events":["appointment.created","appointment.updated","appointment.cancelled","client.created","client.updated","client.deleted","quote.created","quote.updated","quote.deleted","invoice.created","invoice.updated","invoice.deleted","payment.created","intervention.created","intervention.updated","intervention.deleted","project.created","project.updated","project.deleted"],"x-webhooks":{"event":{"post":{"summary":"An event in the workspace","description":"Sent to every active subscription that lists the event, once — there is no automatic retry yet. Headers: `Iwana-Signature: sha256=<hex HMAC-SHA256 of the raw body with the subscription secret>`, `Iwana-Event: <type>`, `Iwana-Delivery: <uuid>`. Answer `2xx` within 15 seconds.","parameters":[{"name":"Iwana-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"Iwana-Event","in":"header","required":true,"schema":{"type":"string","enum":["appointment.created","appointment.updated","appointment.cancelled","client.created","client.updated","client.deleted","quote.created","quote.updated","quote.deleted","invoice.created","invoice.updated","invoice.deleted","payment.created","intervention.created","intervention.updated","intervention.deleted","project.created","project.updated","project.deleted"]}},{"name":"Iwana-Delivery","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"},"example":{"event":"appointment.created","orgId":"of96fzhku1ajprqf37dithpq","occurredAt":"2026-11-10T14:05:11.482Z","livemode":true,"data":{"id":"a9s4d7f2g5h8j1k3l6z0x2c5","startAt":"2026-11-18T09:00:00.000Z","endAt":"2026-11-18T10:30:00.000Z","status":"CONFIRMED","clientId":"k7m2x9q4w1e8r5t3y6u0i2o4","serviceId":"s2d5f8g1h4j7k0l3z6x9c2v5","locationId":"l4k7j0h3g6f9d2s5a8q1w4e7","source":"API"}}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}}}}